Advertisement
Josif_tepe

Untitled

Oct 13th, 2023
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. class Point {
  7. private:
  8.     int x;
  9.     int y;
  10.    
  11. public:
  12.    
  13.     Point() {
  14.        // obicno empty constructor treba da izgleda tokmu vaka
  15.     }
  16.    
  17.     Point(int _x, int _y) {
  18.         x = _x;
  19.         y = _y;
  20.     }
  21.     void pecati() {
  22.         cout << x << " " << y << endl;
  23.     }
  24.    
  25.    
  26. };
  27. int main() {
  28.    
  29.     Point p(5, 6);
  30.    
  31.     p.pecati();
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement