lei.hpp

来自「C++编写的程序源码,里有21天学通C++的课后作业源码和章节源码.」· HPP 代码 · 共 25 行

HPP
25
字号
#include<iostream>
using namespace std;
class cat
{
public:
	cat(int x);//构造函数
	~cat();//析构函数
	int getage() const;//一般不用改变的值的变量或是函数都用常量型的,发生改变时,会告诉出错.
	void setage(int age);
	void meow() const;
private:
	int itsage;
};
int cat::getage()const
{
	return itsage;
}
void cat::setage(int age)
{
	itsage=age;
}
void cat::meow ()const
{
	cout<<"meow.\n";
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?