online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <ctime> using namespace std; time_t addDays(int days) { return time(NULL) + 86400 * days; } void printNewDate(int days) { time_t newtime = addDays(days); cout << asctime(localtime(&newtime)); } int main() { // propozycja @Oscar-a time_t t = time(0); t += (7 * 24 * 3600); tm* nextweek1 = localtime(&t); t = addDays(7); tm* nextweek2 = localtime(&t); cout << nextweek1->tm_mday << "\n"; cout << nextweek2->tm_mday << "\n"; printNewDate(7); cout << endl; return 0; }

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