struct sname
{
int a;
string b;
};
class c
{
sname d[100];
}
请问最终这个数组 d 是建在堆上 还是栈上了?
我的回复:
c obj1;//栈分配
c *obj2=new c;//堆分配
其他人的回复:
栈分配
...全文
1129打赏收藏
看看呗
http://topic.csdn.net/u/20120614/12/563807c8-d48f-49ad-9ee3-63e8e628252f.html struct sname { int a; string b; }; class c { sname d[100]; } 请问最终这个数组 d 是建在堆上 还是栈上了? 我的回复: c obj1;//栈分配 c *obj2=new c;//堆分配 其他人的回复: 栈分配