?? can.cpp
字號:
// Can.cpp
#include "Can.h"
#include <iostream>
Can::Can(double canDiameter, double canHeight) :
diameter(canDiameter), height(canHeight) {}
// Function to calculate the volume of a Can object
double Can::volume() const {
return pi * diameter * diameter * height / 4;
}
Can::~Can() {
std::cout << "Can destructor" << std::endl;
}
// Definitions for the Can class
const double Can::pi = 3.14159265; // Initialize static member
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -