fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class test
  5. {
  6. int x;
  7. public:
  8. test():x(10) {}
  9. friend std::ostream& operator<< (std::ostream& o, test t)
  10. {
  11. o << t.x ;
  12. return o;
  13. }
  14. };
  15.  
  16. int main() {
  17. // your code goes here
  18. test T;
  19. std::cout << T;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
10