Number newNumber(int z)
{
Number num;
num.x = z;
return num;
}
But I wouldn't recommend that.
I would. As long as the struct is small (and this only contains one integer), returning a struct, rather than a pointer to struct is faster than allocating memory.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.