27 lines · cpp
1#include <stdio.h>2 3struct SubStruct4{5 int a;6 int b;7};8 9struct MyStruct10{11 int first;12 struct SubStruct second;13};14 15int16main()17{18 struct MyStruct my_struct = {10, {20, 30}};19 struct MyStruct *my_pointer = &my_struct;20 struct MyStruct *null_pointer = nullptr;21 printf ("Stop here to evaluate expressions: %d %d %p\n", my_pointer->first, my_pointer->second.a, my_pointer);22 return 0;23}24 25 26 27