fork download
  1. // in the name of GOD
  2. #include <iostream>
  3. #include <string>
  4.  
  5. class Base
  6. {
  7. public :
  8. Base(std::string name)
  9. {
  10. std::cout<<"Hello "<<name;
  11. }
  12. };
  13.  
  14. class Child: public Base
  15. {
  16. public :
  17. Child(std::string username="defaultvalue"):Base(username)
  18. {
  19.  
  20. }
  21. };
  22.  
  23. int main()
  24. {
  25. std::string name = "rukee";
  26. Child c(name);
  27.  
  28. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
Hello rukee