?? 靜態成員.cpp
字號:
#include <iostream.h>
class A
{
private:
int count;
public:
A():count(0)
{
cout << "Can you see me Now!" << endl;
}
~A()
{
cout << "I'm Go Away!" << endl;
}
void Inc()
{
count++;
}
int Count()
{
return count;
}
};
void TestStatic( )
{
static A a;
a.Inc();
cout << "count's value is : " << a.Count() << endl;
}
void main()
{
cout << "Program Start!" << endl;
TestStatic();
TestStatic();
TestStatic();
cout << "Program End!" << endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -