?? proj14_01.cpp
字號:
#include <iostream.h>
class Samp{
public:
void Setij(int a, int b){i=a,j=b;}
~Samp(){ cout <<"Destroying.." <<i <<endl; }
int GetMulti(){ return i*j; }
protected:
int i;
int j;
};
void main()
{
Samp* p = new Samp[10];
if(!p){
cout <<"Allocation error\n";
return;
}
for(int j=0; j<10; j++)
p[j].Setij(j,j);
for(int k=0; k<10; k++)
cout <<"Multi[" <<k <<"] is:"
<<p[k].GetMulti() <<endl;
delete[]p;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -