hour08_3.hpp

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

HPP
15
字号
 #include <iostream>

// Rename this file to cat.hpp
// It is no different from the original file in the chapter 

 class Cat

 {

 public:

     Cat (int initialAge);

     ~Cat();

     int GetAge() { 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 + -
显示快捷键?