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
std::vectororstd::array. Also preferring automatic storage over dynamic storage.