moonchild wroteint * myVar = new int[10];
is on the heap.
The pointer myVar is still on the stack, pointing to an address on the heap ;)
Everything is declared on the stack I was talking about the memory...
Can't help but mention it.
new is C++. In C you'd normally use a malloc().
Yes, of course, I was just giving a quick example :)