fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. struct smallDude
  8. {
  9. int int1 = 70;
  10. int int2 = 60;
  11. };
  12.  
  13. struct bigDude
  14. {
  15. // structure within structure
  16. smallDude second;
  17. }first, second;
  18.  
  19. int main()
  20. {
  21. first = {{2, 3}};
  22. cout<< first.second.int1 << endl;
  23. cout<< first.second.int2 << endl;
  24.  
  25. cout << second.second.int1 << endl;
  26. cout << second.second.int2 << endl;
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 5376KB
stdin
Standard input is empty
stdout
2
3
70
60