online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <stdlib.h> struct MyStruct { int val1; int val2; int val3; }; struct MyStruct *MakeStruct(int val1, int val2, int val3) { struct MyStruct *pStruct = (struct MyStruct *)malloc(sizeof(struct MyStruct)); pStruct->val1 = val1; pStruct->val2 = val2; pStruct->val3 = val3; return pStruct; } void PrintStruct(struct MyStruct *pStruct) { printf("MyStruct-Instance: val1 = %d, val2 = %d, val3 = %d\n", pStruct->val1, pStruct->val2, pStruct->val3); } struct MyStruct CopyStruct(struct MyStruct *pStruct) { return *pStruct; } int main() { struct MyStruct *pTest = MakeStruct(1, 2, 3); PrintStruct(pTest); struct MyStruct *pTest2 = MakeStruct(4, 5, 6); PrintStruct(pTest2); *pTest = CopyStruct(pTest2); PrintStruct(pTest); free(pTest2); free(pTest); 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.