fork(3) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. struct Person
  5. {
  6. std::string name;
  7. std::string address;
  8.  
  9. Person (std::string n, std::string a)
  10. {
  11. name = n;
  12. address = a;
  13. }
  14. std::string get_name() { return name; }
  15. std::string get_address() { return address; }
  16. };
  17.  
  18.  
  19.  
  20. int main()
  21. {
  22. const Person p ("User", "UserAddr");
  23.  
  24. std::cout << p.name << " " << p.address << std::endl;
  25. }
  26.  
  27.  
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
User UserAddr