online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <stdlib.h> int increment(int* value){ return (*value)++; } int main(){ //error: int is not int* //int h = 10; //increment(h); int a = 41; //error: int is not int* //int* b = 80 int* b = (int*)malloc(sizeof(int)); //malloc returns a void* so we must cast it into a int* *b = 80; increment(&a); increment(b); printf("variable a: %i\nvariable b: %i\n", a, *b); //a will return 42 and b will return 81 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