3、实例化一个子类对象的内存分配情况?(不能少于200字)
来源:百度知道 编辑:UC知道 时间:2024/04/28 19:05:09
编程
#include<iostream>
using namespace std;
class Contain
{
public:
class Embed
{
public:
Embed()
{
ival = 0;
}
int ival;
} emb;
void show_emb()
{
cout<<" sizeof(emb) = "<<sizeof(emb)<<endl;
cout<<" the address of emb = "<<&emb<<endl;
}
};
int main()
{
Contain con;
con.show_emb();
return 0;
}