Facebook
From Crippled Penguin, 4 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 211
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Wektor
  6. {
  7.     public:
  8.         int a;
  9.         void setb(int z);
  10.         int getb();
  11.  
  12.     private:
  13.         int b;
  14. };
  15.  
  16. void Wektor::setb(int z)
  17. {
  18.     b=z;
  19. }
  20.  
  21. int Wektor::getb()
  22. {
  23.     return b;
  24. }
  25.  
  26. int main()
  27. {
  28.     Wektor u;
  29.     u.a = 3;
  30.     u.setb(4);
  31.     cout << u.getb() << endl;
  32.  
  33.     return 0;
  34. }
  35.