Q. What is the output of the following C++ code?
Code:
#include<iostream>
using namespace std;
class Point {
private:
int x;
int y;
public:
Point(int a, int b);
};
Point::Point(int a = 0, int b = 0) {
x = a;
y = b;
cout << "Constructor called";
}
int main()
{
Point p1, *p2;
return 0;
}
✅ Correct Answer: (A)
Displays “Constructor called” only once.