fork(3) download
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. class MyClass
  6. {
  7. string figName;
  8. public:
  9. MyClass(const string& s)
  10. {
  11. figName = s;
  12. }
  13.  
  14. const string& getName() const
  15. {
  16. return figName;
  17. }
  18. };
  19. ostream& operator<<(ostream& ausgabe, const MyClass& f)
  20. {
  21. ausgabe << f.getName();
  22. return ausgabe;
  23. }
  24.  
  25. int main()
  26. {
  27. MyClass f1("Hello");
  28. cout << f1;
  29. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Hello