一个C++简单问题,不是很明白,高手支招?
#include <iostream.h>
class Time
{
private:
int hour;
int minute;
int second;
public:
void set(int hh, int mm, int ss)
{
hour = hh;
minute = mm;
second = ss;
}
void display()
{
cout<<"The time is "<< hour << ":" << minute << ":" << second <<endl;
}
};
void main()
{
Time a;
a.set(22,42,33);
a.display;
}
这个程序在VC中一运行,就出现press any key to continue
别的什么都没有,为什么呀,为什么不会出现The time is 22:42:33