c01-file1
来自「C++面向对象课程设计课件」· 代码 · 共 20 行
TXT
20 行
#ifndef FILE1H
#define FILE1H
namespace namespaceFile1
{
class Dog
{
public:
Dog(int a=1):age(a) {}
int GetAge() const {return age;}
void Bite() const;
void Sleep() const;
void AddAge(int step=1) {age+=step;}
private:
int age;
};
//可以加入其他声明
//...
}
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?