文章
3
粉丝
298
获赞
0
访问
31.1k
#include<iostream>
#include <string>
using namespace std;
class Base
{
public:
string content;
Base(string c)
{ content=c; cout<<"Base 构造函数!"<<endl; }
Base(const Base& b)
{ content=b.content; cout<<"Base 拷贝构造函数!"<<endl; }
};
class Div:public Base
{
public:
Div(string cc)
{ cout<<"Div 构造函数!"<<endl; }
Div(const Div& d)
{ cout<<"Div 拷贝构造函数!"<<endl; }
};
int main()
{
Div a("aaa"),b(a); return 0;
}
登录后发布评论
暂无评论,来抢沙发