| 查看: 288 | 回复: 2 | |||
| 当前主题已经存档。 | |||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | |||
[交流]
【求助】帮我看下vc++ 6.0的这个类继承哪里出问题了?【已完结】
|
|||
|
#include class Box { int width,height; public: void SetWith(int w) { width=w; } void SetHeight(int h) { height=h; } int GetWidth(){return width;} int GetHeight(){return height;} }; class ColoredBox:public Box { int color; public: voidSetColor(int c) { color=c; } int GetColor(){return color;} }; main(void) { ColoredBox cbox; cbox.SetColor(3); cbox.SetWidth(150); cbox.SetHeight(100); cout<<"cbox:"< --Configuration: 1019 - Win32 Debug-------------------- Compiling... 10191.cpp c:\program files\microsoft visual studio\myprojects\1019\10191.cpp(27) : warning C4183: 'voidSetColor': member function definition looks like a ctor, but name does not match enclosing class c:\program files\microsoft visual studio\myprojects\1019\10191.cpp(34) : error C2039: 'SetColor' : is not a member of 'ColoredBox' c:\program files\microsoft visual studio\myprojects\1019\10191.cpp(20) : see declaration of 'ColoredBox' c:\program files\microsoft visual studio\myprojects\1019\10191.cpp(35) : error C2039: 'SetWidth' : is not a member of 'ColoredBox' c:\program files\microsoft visual studio\myprojects\1019\10191.cpp(20) : see declaration of 'ColoredBox' c:\program files\microsoft visual studio\myprojects\1019\10191.cpp(42) : warning C4508: 'main' : function should return a value; 'void' return type assumed 执行 cl.exe 时出错. 1019.exe - 1 error(s), 0 warning(s) [ Last edited by 余泽成 on 2010-1-28 at 10:45 ] |
» 猜你喜欢
心脉受损
已经有7人回复
之前让一硕士生水了7个发明专利,现在这7个获批发明专利的维护费可从哪儿支出哈?
已经有9人回复
博士申请都是内定的吗?
已经有8人回复
博士读完未来一定会好吗
已经有32人回复
读博
已经有5人回复
投稿精细化工
已经有4人回复
高职单位投计算机相关的北核或SCI四区期刊推荐,求支招!
已经有4人回复
导师想让我从独立一作变成了共一第一
已经有9人回复
Springer期刊投稿求助
已经有4人回复

3楼2009-10-20 10:54:42













回复此楼