弱弱的问一下
初学C++,哪位帮忙解释一下这个程序怎么不能输出啊~~~#include<iostream>
using namespace std;
class Time{
public:
void settime(int h,int m,int s);
void printtime();
// int gethour(int);
// int getminute(int);
private:
int hour;
int minute;
int second;
};
void Time::settime(int h,int m,int s)
{
/* hour=h;
minute=m;
second=s;*/
hour=9;
minute=20;
second=30;
}
int main()
{
Time t1;
//t1.settime(9,20,30);
cout<<"t1="<<t1.settime ()<<endl;
return 0;
}