carton.h

来自「c++最经典的入门书籍」· C头文件 代码 · 共 27 行

H
27
字号
// Carton.h
#ifndef CARTON_H
#define CARTON_H

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

class Carton : public Box {
  public:
    // Constructor explicitly calling the base constructor
    Carton(double lv, double wv, double hv, string material = "Cardboard");

    // Copy constructor
    Carton(const Carton& aCarton);

    // Destructor
    ~Carton();

    // Function to calculate the volume of a Carton object
    virtual double volume(const int i = 50) const;
  private:
    string* pMaterial;
};

#endif

⌨️ 快捷键说明

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