⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prog15_05.cpp

📁 一本语言类编程书籍
💻 CPP
字号:
// Program 15.5 Using a derived class copy constructor File: prog15_05.cpp
#include <iostream>
#include "Box.h"                                       // For the Box class
#include "Carton.h"                                    // For the Carton class
using std::cout;
using std::endl;

int main() {
   Carton candyCarton(20.0, 30.0, 40.0, "Glassine board"); // Declare and initialize
   Carton copyCarton(candyCarton);                         // Use copy constructor

   cout << endl
        << "Volume of candyCarton is " << candyCarton.volume()
        << endl
        << "Volume of copyCarton is " << copyCarton.volume()
        << endl;

   return 0;
}

⌨️ 快捷键说明

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