标题:error C2064: term does not evaluate to a function
只看楼主
cancerhd
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-7-25
 问题点数:0 回复次数:7 
error C2064: term does not evaluate to a function
w0ySM7NS.rar (1.5 KB) error C2064: term does not evaluate to a function


搜索更多相关主题的帖子: term does function evaluate 
2007-08-02 15:37
medicihophy
Rank: 1
等 级:新手上路
威 望:1
帖 子:102
专家分:0
注 册:2007-7-28
得分:0 
我看了你的程序,你类的设计都有点问题!

2007-08-02 15:53
cancerhd
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-7-25
得分:0 

你有qq么,联系的方便点

2007-08-02 15:59
medicihophy
Rank: 1
等 级:新手上路
威 望:1
帖 子:102
专家分:0
注 册:2007-7-28
得分:0 

#include<iostream>
using std::cout;
using std::endl;
class Time
{
public:
Time();
void setTime(int ,int, int);
void printMilitary();
void printStandard();

private:
int hour;
int minute;
int second;


};
Time::Time()
{
hour = minute = second = 0;
}

void Time::setTime(int h,int m,int s)
{
hour = (h >= 0 && h <= 24)?h:0;
minute = (m >= 0 && m<= 60)?m:0;
second = (s >= 0 && s<= 60)?s:0;
}

void Time::printMilitary ()
{
cout<<(hour < 10 ?"0" :" ")<<hour<<":"
<<(minute < 10 ?"0" :" ")<<minute;

}

void Time::printStandard ()
{
cout<<((hour == 0 || hour ==12 ) ?
12 : hour & 12)
<<":"<<(minute < 10 ? "0" : " ")<<minute
<<":"<<(second < 10 ? "0" : " ")<<second
<<(hour < 12 ? "AM" : "PM");
}

int main()
{
Time t;

cout<<" the initial military time is: ";
t.printMilitary();
cout<<"the initial standard time is: ";
t.printStandard();

t.setTime(13,27,6);
cout<<"\n\n Military time after setTime is: ";
t.printMilitary();
cout<<"the standard time after setTime is: ";
t.printStandard();

t.setTime(99,99,99);
cout<<"\n\n after attempting invalid setting: "
<<"\n military time:";
t.printMilitary();
cout<<"\nstandard time:";
t.printStandard();
cout<<endl;

return 0;
}
这是改后的,你自己再分开!


2007-08-02 16:00
medicihophy
Rank: 1
等 级:新手上路
威 望:1
帖 子:102
专家分:0
注 册:2007-7-28
得分:0 
说你的吧,我加你

2007-08-02 16:01
cancerhd
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-7-25
得分:0 
283699636
2007-08-02 16:05
cancerhd
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-7-25
得分:0 
分开了还是有错误呀。
2007-08-02 16:37
medicihophy
Rank: 1
等 级:新手上路
威 望:1
帖 子:102
专家分:0
注 册:2007-7-28
得分:0 
把你分开的再发出来

2007-08-02 16:38



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




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

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