hour08_2.hpp

来自「《24学时精通c++》的随书源码的下半部分。欢迎下载学习。」· HPP 代码 · 共 17 行

HPP
17
字号
// you will need to rename this file to cat.hpp
// GetAge has been declared const, that it will not change anything
// in the object
 #include <iostream>

 

 class Cat

 {

 public:

     Cat (int initialAge);

     ~Cat();

     int GetAge() const { return itsAge;}             // inline!

     void SetAge (int age) { itsAge = age;}     // inline!

     void Meow() { std::cout << "Meow.\n";}     // inline!

 private:

     int itsAge;

 };

⌨️ 快捷键说明

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