online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <stdbool.h> struct node { int key; int value; struct node* next_node; }; struct linkedList { struct node* first_node; void (*initFirstNode)(struct linkedList* self); void (*initFirstNodeKV)(struct linkedList* self, int key, int value); void (*push)(struct linkedList* self, int key, int value); }; void linkedList_initFirstNode(struct linkedList* self); void linkedList_initFirstNodeKV(struct linkedList* self, int key, int value); void linkedList_push(struct linkedList* self, int key, int value); int main() { // int A1; // scanf("%d", &A1); // int N; // scanf("%d", &N); // struct node n0; struct linkedList linkedList; linkedList.initFirstNode = &linkedList_initFirstNode; linkedList.initFirstNodeKV = &linkedList_initFirstNodeKV; linkedList.push = &linkedList_push; // linkedList.first_node = &n0; // (*linkedList.first_node).key = 7; // printf("%d\n", n0.key); // linkedList.initFirstNode(&linkedList); linkedList.initFirstNodeKV(&linkedList, 8, 15); linkedList.push(&linkedList, 4, 23); // printf("%d\n", (*linkedList.first_node).value); // printf("%d\n", (*(*linkedList.first_node).next_node).value); return 0; } void linkedList_initFirstNode(struct linkedList* self) { struct node n; n.key = 0; n.value = 0; n.next_node = NULL; (*self).first_node = &n; } void linkedList_initFirstNodeKV(struct linkedList* self, int key, int value) { struct node n; n.key = key; n.value = value; n.next_node = NULL; (*self).first_node = &n; printf("%d\n", (*self).first_node->key); printf("%p\n", (*self).first_node); } void linkedList_push(struct linkedList* self, int key, int value) { // struct node n; // n.key = key; // n.value = value; // n.next_node = (*self).first_node; //(*(*self).first_node).key = 16; printf("%d\n", (*(*self).first_node).key); printf("%p\n", (*self).first_node); // printf("%d\n", n.key); // (*self).first_node = &n; }

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