online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
char* Title = "Demo Array of Pointers"; #include <stdio.h> struct cat { int number; struct cat* next; }; struct cat dog[10]; #define dimensionof(p) (sizeof(p)/sizeof(p[0])) int main() { printf("%s\n", Title); for (int i=0; i<dimensionof(dog); i++) { dog[i].number = i; if (i<dimensionof(dog)-1) dog[i].next = &dog[i+1]; else dog[i].next = NULL; } struct cat* ptr = &dog[0]; while (ptr != NULL) { printf("%d\n", ptr->number); ptr = ptr->next; } printf("%d\n", ptr->number); 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