📄 prog15_07a.cpp
字号:
// Program 15.7a Using multiple inheritance. Compilable version!
// File: prog15_07a.cpp
#include <iostream>
#include "CerealPack.h" // For the CerealPack class
using std::cout;
using std::endl;
int main() {
CerealPack packOfFlakes(8.0, 3.0, 10.0, "Cornflakes");
cout << endl;
cout << "packOfFlakes volume is " << packOfFlakes.Carton::volume() << endl;
cout << "packOfFlakes weight is "
<< packOfFlakes.Carton::getWeight()+packOfFlakes.Contents::getWeight()
<< endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -