derived.h

来自「经典vc教程的例子程序」· C头文件 代码 · 共 24 行

H
24
字号
// Fig. 9.11: derived.h
// Definition of class Derived which inherits
// multiple base classes (Base1 and Base2).
#ifndef DERIVED_H
#define DERIVED_H

#include "base1.h"
#include "base2.h"

// multiple inheritance
class Derived : public Base1, public Base2 {
   friend ostream &operator<<( ostream &, const Derived & );

public:
   Derived( int, char, double );
   double getReal() const;

private:
   double real;   // derived class's private data
};

#endif

⌨️ 快捷键说明

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