第七周项目—阅读程序
来源:互联网 发布:js计时器的启动与停止 编辑:程序博客网 时间:2024/05/22 05:20
#include <iostream>#include <string>using namespace std;class Box{ public: Box(int h,int w,int l):height(h),width(w),length(l){} int volume( ){return height*width*length;}; private: static int height; //静态的数据成员 int width; int length;};int main(){ Box b(2,3,4); cout<<"volume is "<<b.volume()<<endl; return 0;}
错误原因:不能在构造函数中对静态的数据成员初始化。
- 第七周项目—阅读程序
- 第七周项目:阅读程序改错
- 第七周—改错(阅读程序)
- 第七周上机阅读程序
- 第七周阅读程序----改错
- (补)第七周阅读程序
- 第七周阅读程序——语法改错
- 第十五周项目—阅读程序(1)
- 第十五周项目—阅读程序(2)
- 第十五周项目-阅读程序—1
- 第十五周项目—阅读程序(3)
- 第十五周项目—阅读程序(4)
- 第十五周项目—阅读程序(5)
- 第十五周项目—阅读程序(6)
- 第十五周项目—阅读程序(4)
- 第十五周项目—阅读程序(5)
- 第十五周项目—阅读程序(6)
- 第十二周项目-阅读程序
- IOS 页面跳转方式总结
- 改错
- 想学编程?像我这样开始吧 转至微资讯
- Windows Gdi & CDC和HDC的区别与转换
- ostream_iterator用法,以及unique_copy函数功能测试
- 第七周项目—阅读程序
- 如何正确选择AD/DA器件
- linux的hostname修改详解
- Spring-Instantiation bean with a static factory method
- 第七周上机阅读程序
- 开始写学习笔记,Mark一下
- 第七周-第一部分
- 第七周阅读程序----改错
- #define WIN32_LEAN_AND_MEAN作用