Charlie,
>Are all pointers created on the heap and regular variables created on stack?
No. If the pointers are object members they wouldn't be on the stack unless the whole object was on the stack.
void Func1( void )
{
SomeClass o;
SomeClass *op;
int i;
}
All of the above variables are on the stack, you have a full object (o), a pointer that would hold a reference to an object, and a plain old int.
You could do:
op = &o; //
might have the syntax off a little I don't write C++ everyday now, make op point to the instance of the object o that's on the stack
op = new SomeClass; // allocate a SomeClass object on the heap and point the variable to it