online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <fstream> using namespace std; struct ProcessRecords { string ID; int arrival; int wait; int burst; void putToFile() { ofstream input; input.open("process.txt", ofstream::app); input << ID << "\t" << arrival << "\t" << wait << "\t" << burst << endl; input.close(); } }; int main() { int numProcess; int algo; cout << "\n\t\t=== CPU SCHEDULING ALGORITHMS ===\n"; cout << "\n\t\tEnter number of processes: "; cin >> numProcess; ProcessRecords process[numProcess]; string processID[numProcess]; int arrTime[numProcess]; int waitTime[numProcess]; int burstTime[numProcess]; cout << endl << endl; for (int i = 0; i < numProcess; i++) { cout << "\n\tEnter process ID for Process " << i+1 << ":\t "; cin >> processID[i]; process[i].ID = processID[i]; cout << "\n\t\tEnter arrival time for " << processID[i] << ":\t "; cin >> arrTime[i]; process[i].arrival = arrTime[i]; cout << "\n\t\tEnter waiting time for " << processID[i] << ":\t "; cin >> waitTime[i]; process[i].wait = waitTime[i]; cout << "\n\t\tEnter burst time for " << processID[i] << ":\t "; cin >> burstTime[i]; process[i].burst = burstTime[i]; process[i].putToFile(); } return 0; }
ID1 12 32 42 ID2 325 53 1

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