For example say I have:
Class Foo
{
public:
Foo(int someNum);
private:
int x;
};
Foo::Foo(int someNum)
{
x = someNum;
}
which I then use later in my program:
int main()
{
Foo x(10); //x object is put onto the stack
Foo* y = new Foo(10); //y points to a foo object on heap
return 0;
}
Would the member variables of object pointed to by y be on the stack? or heap? Do I even need to concern myself with this sort of detail?
Thanks.






