//I need help please?
#include<stdio.h>
#include<iostream.h>
class Time
{
public:
Time();
~Time();
void setTime(int, int, int);
void printMilitary();
void printStandard();
private:
int hour, minute, second;
};
void Time::printMilitary()
{
cout<<"Military time: "<<hour<<minute<<second;
}
Time::Time()
{
hour=minute=second=0;
}
Time::~Time()
{
cout<<endl<<"Destructor code.";
}
void main()
{
Time wakeup, samplePM;
wakeup.setTime(6, 5, 0);
samplePM.setTime(15, 30, 24);
cout<<"I wake up at";
wakeup.printMilitary();
cout<<"\nIn standard time: ";
wakeup.printStandard();
cout<<"\nIn Snack time: ";
samplePM.printMilitary();
cout<<"\nIn standard time: ";
samplePM.printStandard();
getch();
}
//It has an error, it says:
//function 'getch' should return a value
//Why did the compiler treat it as a function and are the header files lacking or what?
//thanks