e-5-1.txt
来自「最后声明」· 文本 代码 · 共 34 行
TXT
34 行
#include "stdafx.h"
#include <iostream>
using namespace std;
class Test{
private:
int i;
public:
Test(int n);
~Test();
void prin();
};
Test::Test(int n){
cout<<"构造函数已经调"<<endl;
}
Test::~Test()
{ cout<<"析构函数已经调用"<<endl;
}
void Test::prin(){cout<<i<<endl;
}
int main()
{ Test a(1),b(2);
cout<<"开始值a;i=";
a.prin();
cout<<"开始值b:i=";
b.prin();
return 0;
system("pause");
getchar();
if(getchar()!='\0')
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?