fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. class Wektor
  5. {
  6. int x;
  7. public:
  8. Wektor():x(0){}
  9.  
  10. friend ostream& operator<<(ostream& out,const Wektor& ob)
  11. {
  12. return out << ob.x;
  13. }
  14. static int zmien(Wektor * const thisObj, int y)
  15. {
  16. return thisObj->x=y;
  17. }
  18.  
  19. };
  20. int main()
  21. {
  22. Wektor w;
  23. cout << w;
  24. operator<<(cout,w);
  25. cout << Wektor::zmien(&w, 20);
  26. return 0;
  27. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
0020