标题:关于类的问题
取消只看楼主
菜鸟,求帮忙
Rank: 4
等 级:业余侠客
帖 子:197
专家分:267
注 册:2015-7-11
结帖率:85.71%
已结贴  问题点数:10 回复次数:3 
关于类的问题
这个程序错哪了,请指教(特别是关于类的)
#include "iostream"
using namespace std;
class clock
{
  public:
         void settime(int newH,int newM,int newS);
         void showtime();
  private:
          int Hour,Minute,Second;
};
v
oid clock::showtime(){
  cout<<Hour<<":"<<Minute<<":"<<Second<<endl;
}
void clock::settime(int H,int M,int S)
{
 Hour=H;
 Mintue=M;
 Second=S;
}
clock::clock
void main()
{
  clock myclock;
  myclock.settime(20,40,26);
  myclock.showtime();
}
搜索更多相关主题的帖子: private include public 
2015-07-12 16:02
菜鸟,求帮忙
Rank: 4
等 级:业余侠客
帖 子:197
专家分:267
注 册:2015-7-11
得分:0 
额,说清楚点啦,不是那个,那是复制的时候弄得(只是个意外),
2015-07-13 10:05
菜鸟,求帮忙
Rank: 4
等 级:业余侠客
帖 子:197
专家分:267
注 册:2015-7-11
得分:0 
F:\彭苏庄\类2.cpp In membe18
 F:\彭苏庄\类2.cpp `Mintue' undeclared (first use this function) r function `void clock::settime(int, int, int)':
                    (Each undeclared identifier is reported only once for each function it appears in.)
                    At global scope:
22 F:\彭苏庄\类2.cpp expected unqualified-id before "void"
22 F:\彭苏庄\类2.cpp expected constructor, destructor, or type conversion before "void"
22 F:\彭苏庄\类2.cpp expected `,' or `;' before "void"
这是错误提示
2015-07-13 10:08
菜鸟,求帮忙
Rank: 4
等 级:业余侠客
帖 子:197
专家分:267
注 册:2015-7-11
得分:0 
算了吧,完全看不懂
2015-07-13 12:19



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




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

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