online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
# include <iostream> # include "TIME.H" using namespace std; int main() { Time a(0,0,0); a.setTime(12,23,18); return 0; }
# ifndef TIME1_H # define TIME1_H class Time { public: Time(int,int,int); // default constructor void setTime(int,int,int); // set hour, minute, second void printMilitary(); void printStandard(); private: int hour; int minute; int second; }; # endif
# include <iostream> # include "TIME.H" using namespace std; // Implementing the functions Time::Time(int phour, int pminute, int psecond): hour(phour), minute(pminute), second(psecond) { } void Time::setTime(int hour,int minute,int second) { setTime(hour,minute,second); } void Time::printMilitary() { if(hour>=1200&&hour<=2359) { hour-1200; cout<<hour<<":"<<minute; } if(hour<1200&&hour>=100) { cout<<hour<<":"<<minute<<":"<<second<<" AM"; } else { cout<<hour<<":"<<minute<<":"<<second; } } void Time::printStandard() { if(hour) { cout<<hour<<":"<<minute<<":"<<second; } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue