?? stat_mem.cpp
字號:
#include <iostream.h>
class shared
{
static int a;
int b;
public:
void set(int i, int j)
{
a=i;
b=j;
}
void show();
};
int shared::a; // Define the a global variable
void shared::show()
{
cout << "This is static a: " << a << endl;
cout << "This is non-static b: " << b << endl;
}
void main(void)
{
shared x, y;
x.set(1,1);
x.show();
y.set(2,2);
y.show();
x.show();
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -