Skip to content
Related Articles

Related Articles

Improve Article

C++ | Constructors | Question 4

  • Last Updated : 28 Jun, 2021

using namespace std;
class Point {
    Point() { cout << "Constructor called"; }
int main()
   Point t1, *t2;
   return 0;

(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

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :