online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> #include <stdlib.h> enum TYPES {TYPE_STRING, TYPE_NUMBER}; struct Value { void * value; int type; }; int main(int argc, char *argv[]) { // add element one struct Value val1; val1.value = "Hello"; val1.type = TYPE_STRING; printf("Struct1: {value: %s | type: %d}\n", (char *) val1.value, val1.type); // can also initialize it like this struct Value val2 = {.value = "goodbye", .type = TYPE_STRING}; printf("Struct2: {value: %s | type: %d}\n", (char *) val2.value, val2.type); // how to initialize a number though? int number = 2; struct Value val3 = {.value = &number, .type = TYPE_NUMBER}; printf("Struct2: {value: %d | type: %d}\n", (int) val3.value, val3.type); }

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