fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. class person {
  5. class address {
  6. public: // <<<<<<<<<<<<<<<
  7. std::string addr;
  8. int pobox;
  9.  
  10. address() {
  11. addr = "Some Address";
  12. pobox = 200;
  13. }
  14. };
  15.  
  16. address a;
  17.  
  18. public: // <<<<<<<<<<<<<<<
  19. void Test() {
  20. std::cout << a.addr;
  21. }
  22. };
  23.  
  24. int main() {
  25. person p;
  26. p.Test();
  27. return 0;
  28. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Some Address