online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
void B (int* worthRef) { /* worthRef is a pointer to the netWorth variable allocated on the heap. */ *worthRef = *worthRef + 1; } void A() { int *netWorth = (int *) malloc(sizeof(int)); *netWorth = 20; B(netWorth); printf("%d", *netWorth); // Also prints 21 free(netWorth); } int main() { A(); }

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