?? c13_02.cpp
字號:
#include <iostream >
using namespace std;
class CCat
{
int m_age;
int m_weight;
public:
CCat( ) //構造函數,對類成員進行初始化
{
m_age = 0;
m_weight = 0 ;
cout<< "構造一個CCat類對象,年齡:" <<m_age <<" ,體重:"<< m_weight <<endl;
}
void play( )
{
cout<<"貓喜歡玩"<<endl;
}
void hunt()
{
cout<<"貓捉老鼠"<<endl;
}
};
int main( )
{
CCat maomi;
maomi.hunt( );
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -