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

📄 cpp01.cpp

📁 C++参考书
💻 CPP
字号:

// Coded by plusir -- Dec.30.2002.
// Standard C++ Bible -- (P272-11-1)

#include <iostream>
using namespace std ;

class Box
{
	public:
		Box( int, int, int ) ;
		~Box( void ) ;
		int volume( void ) ;

	private:
		int height ;
		int width ;
		int depth ;
} ;

int main()
{
	Box thisBox( 7, 8, 9 ) ;

	int volume = thisBox.volume() ;

	cout << volume << endl ;

	return 0 ;
}

Box::Box( int h, int w, int d )
{
	cout << "Construction" << endl ;
	height = h ;
	width = w ;
	depth = d ;
}

Box::~Box( void )
{
	cout << "Destruction" << endl ;
}

int Box::volume( void )
{
	return width * height * depth ;
}

⌨️ 快捷键说明

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