#include<iostream> using namespace std; class Point { public: Point() { cout << "Constructor called"; } }; int main() { Point t1, *t2; return 0; } |
chevron_right
filter_none
(A) Compiler Error
(B) Constructor called
Constructor called
(C) Constructor called
Answer: (C)
Explanation: Only one object t1 is constructed here. t2 is just a pointer variable, not an object
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
Recommended Posts:
- C++ | Constructors | Question 5
- C++ | Constructors | Question 6
- C++ | Constructors | Question 17
- C++ | Constructors | Question 1
- C++ | Constructors | Question 10
- C++ | Constructors | Question 14
- C++ | Constructors | Question 2
- C++ | Constructors | Question 9
- C++ | Constructors | Question 3
- C++ | Constructors | Question 8
- C++ | Constructors | Question 7
- C++ | Constructors | Question 15
- C++ | Constructors | Question 16
- C++ | Constructors | Question 13
- C++ | Constructors | Question 17
- C++ | Constructors | Question 12
- Java | Constructors | Question 4
- Java | Constructors | Question 1
- Java | Constructors | Question 3
- Java | Constructors | Question 8

