Advertisement
Josif_tepe

Untitled

Oct 13th, 2023
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 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.         cout << "empty constructor" << endl;
  13.        
  14.         // ova znaci deka koga ke pravime objekt od Point avtomatski x i y ke imaat vrednost od 5
  15.         x = 5;
  16.         y = 5;
  17.     }
  18.    
  19.    
  20. };
  21. int main() {
  22.    
  23.     Point p;
  24.     cout << p.x << " " << p.y << endl;
  25.     return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement