标题:请大家看看哪里错了,并指出修正。谢谢
取消只看楼主
roje123
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2010-6-22
结帖率:100%
已结贴  问题点数:5 回复次数:1 
请大家看看哪里错了,并指出修正。谢谢
#include"iostream.h"

Class Time
{
     int h,m,s;
public:
     void set(int x,int y,int z);
     Time(int x=0,int y=0,int z=0);
     void Display();
};
Time::Time(int x,int y,int z)
{
  h=x;
  m=y;
  s=z;
}
void Time::set(int x,int y,int z)
{
  h=x;
  m=y;
  s=z;
}
void Time::display()
{
 cout<<h<<"时"<<m<<"分"<<s<<"秒"<<endl;
}
void main()
{
  Time h;
  h.display();
  h.set(14,24,30);
  h.display();
}

[ 本帖最后由 roje123 于 2010-6-23 18:40 编辑 ]
2010-06-23 18:32
roje123
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2010-6-22
得分:0 
出现了这样的错误提示,是什么意思?
D:\VC++6.0\MSDev98\MyProjects\3\3.cpp(4) : error C2146: syntax error : missing ';' before identifier 'Time'
D:\VC++6.0\MSDev98\MyProjects\3\3.cpp(4) : error C2501: 'Class' : missing storage-class or type specifiers
D:\VC++6.0\MSDev98\MyProjects\3\3.cpp(4) : fatal error C1004: unexpected end of file found


看不懂
2010-06-23 18:40



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-311059-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.227732 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved