online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <stdio.h> #include <string.h> struct student_course_detail { int course_id; char course_name[50]; }; struct student_detail { int id; char name[20]; // structure within structure struct student_course_detail *course[2]; }stu_data[2], *stu_data_ptr[2]; struct student_course_detail course_data[2] = { {71145, "Course 1"}, {33333, "Course 2"}, }; struct student_detail stu_data[2] = { {1, "Anna", &course_data[1]}, {2, "Tom", &course_data[2]} }; int main() { stu_data_ptr[2] = &stu_data[2]; printf(" Id is: %d \n", stu_data_ptr[0]->id); printf(" Name is: %s \n", stu_data_ptr[0]->name); printf(" Course Id is: %d \n", stu_data_ptr[0]->course[0]->course_id); //printf(" Course Name is: %s \n", // stu_data_ptr[0]->course[0]->course_name); //printf(" Course Id is: %d \n", // stu_data_ptr[0]->course[1]->course_id); //printf(" Course Name is: %s \n", // stu_data_ptr[0]->course[1]->course_name); 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