Advertisement
Josif_tepe

Untitled

Sep 1st, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct point {
  5.     double x, y;
  6.     point(){ // empty constructor / default constructor
  7.         x = 0;
  8.         y = 0;
  9.         cout << "empty constructor" << endl;
  10.     }
  11.    
  12.     point(double _x , double _y) { // parameterized constructor
  13.         x = _x;
  14.         y = _y;
  15.         cout << "parameterized constructor" << endl;
  16.     }
  17. };
  18. int main() {
  19.     point p(10, 10);
  20.     point x;
  21.    
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement