Q:

Stack and heap memory in c++

If I declare a variable as
 int a[100]

it is said that an array with 100 elements created on stack, and can be a bad idea depending on size etc.
Consider I define a structure
 struct abc
 {
    int a[100];
 };

and somewhere in code I utilize this structure as
 abc P; //line 1
 abc *p = new abc(); //line 2

Now the array is inside these two objects( one on stack(line 1) and one on heap (line 2) ). Where does the internal array reside? 
Thanks

A:

The location for a data member depends on the location of the object contains it. When the struct is on the stack, all its members are on the stack. When the struct is on the heap, so are the members.

