Advertisement
Josif_tepe

Untitled

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