online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<stdio.h> #include<unistd.h> #include<stdlib.h> #include <sys/wait.h> int main() { pid_t pid; int a = 10; pid = fork(); switch(pid) { case -1: perror("fork"); exit(1); case 0: printf("child pid %d\n",getpid()); a = 20; printf("child: a %d\n",a); exit(1); default: wait(NULL); printf("parent pid %d\n",getpid()); printf("parent: a %d\n",a); break; } 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