Skip to content

Tag Archives: C++-Constructors

What is the output of following program? #include <iostream> using namespace std;    class Point {     int x, y; public:    Point(const Point &p) { x… Read More
#include<iostream> using namespace std;    class X  { public:     int x; };    int main() {     X a = {10};     X b = a;     cout… Read More
Output of following program? #include<iostream> using namespace std;    class Point { public:     Point() { cout << "Normal Constructor called\n"; }     Point(const Point &t) {… Read More
#include<iostream> using namespace std; class Point { public:     Point() { cout << "Constructor called"; } };    int main() {    Point t1, *t2;    return 0;… Read More
Output of following program? #include<iostream> using namespace std; class Point {     Point() { cout << "Constructor called"; } };    int main() {    Point t1;… Read More
When a copy constructor may be called? (A) When an object of the class is returned by value. (B) When an object of the class… Read More