dog.h

来自「C++上机课的习题答案」· C头文件 代码 · 共 34 行

H
34
字号
// Chapter 10 of C++ How to Program
// Debugging Problem (dog.h)

#ifndef DOG_H
#define DOG_H

#include "animal.h"
#include <string.h>
using std::string;

// class Dog definition
class Dog : public Animal {

public:
   Dog( int = 0, int = 0, string = "Toto" );
       
   virtual void print() const;
   virtual int getHeight() const;
   virtual int getWeight() const;
   string getName() const;
   void setName( string );

private:
   bool useMetric( string ) const;
   string name;
   int metricHeight;
   int metricWeight;

}; // end class Dog

#endif // DOG_H


⌨️ 快捷键说明

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