📄 exe8.1.cpp
字号:
#include <iostream.h>
class A
{
public:
A()
{
a1=a2=0;
cout<<"Default constructor called.\n";
}
A(int i,int j);
~A()
{ cout<<"Destructor called.\n"; }
void Print()
{ cout<<"a1="<<a1<<','<<"a2="<<a2<<endl; }
private:
int a1,a2;
};
A::A(int i,int j)
{
a1=i;
a2=j;
cout<<"Constructor called.\n";
}
void main()
{
A a,b(5,8);
a.Print();
b.Print();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -