fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using std::string;
  5.  
  6. class Dog
  7. {
  8. protected:
  9. string m_name, m_breed, m_color;
  10. int m_age;
  11. public:
  12. Dog() : m_name("Fido"), m_breed("Corgi"), m_color("Black"), m_age(1) {}
  13. Dog(const Dog& d) { m_name = d.getName(); m_age = d.getAge(); }
  14. string getName() const { return m_name; }
  15. int getAge() const { return m_age; }
  16. };
  17.  
  18. int main()
  19. {
  20. }
  21.  
Success #stdin #stdout 0s 3092KB
stdin
Standard input is empty
stdout
Standard output is empty