vehicle.h

来自「《标准C++宝典》源码」· C头文件 代码 · 共 27 行

H
27
字号
////////////////////////////////////////
// File Name: Vehicle.h
////////////////////////////////////////
#ifndef VEHICLE_H
#define VEHICLE_H

#include <string>
#include "DisplayObject.h"

class Vehicle : public virtual DisplayObject
{
    int year;
    std::string model;

public:
    Vehicle(int yr, const std::string& md) :
        year(yr), model (md) { }
    virtual ~Vehicle() { }
    void MaintenanceSchedule()
    {
        std::cout << "Maintenance Schedule" << std::endl;
        std::cout << year << " " << model << std::endl;
    }
};

#endif

⌨️ 快捷键说明

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