Quote Originally Posted by zacs7 View Post
Yeah, it's allocated on the "heap".

You can do it all on the stack too,

Code:
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