主题:越简单越容易出错
各位大大,偶有一疑问之上
希望螚以解我的疑惑 我编译了很多次 总有一给错误
#include <iostream>
using namespace std;
class clock
{
public:
void settime(int hour,int minute,int second);
void showtime();
private:
int shour,sminute,ssecond;
};
void clock::settime(int hour,int minute,int second)
{
cin>>hour>>minute>>second;
shour=hour;
sminute=minute;
ssecond=second;
}
void clock::showtime()
{
cout<<shour<<":"<<sminute<<ssecond;
}
int main()
{
class clock a;
a.settime(int hour,int minute,int second);
a.showtime();
return 0;
}
希望螚以解我的疑惑 我编译了很多次 总有一给错误
#include <iostream>
using namespace std;
class clock
{
public:
void settime(int hour,int minute,int second);
void showtime();
private:
int shour,sminute,ssecond;
};
void clock::settime(int hour,int minute,int second)
{
cin>>hour>>minute>>second;
shour=hour;
sminute=minute;
ssecond=second;
}
void clock::showtime()
{
cout<<shour<<":"<<sminute<<ssecond;
}
int main()
{
class clock a;
a.settime(int hour,int minute,int second);
a.showtime();
return 0;
}