![]() Related Questions Latest Answer : In C++, assignment and copy construction are different because the copy constructor initializes uninitialized memory, whereas assignment starts with an existing initialized object. If your class contains instances of other classes as data members, the ... Latest Answer : A constructor is executed when an object of a class is getting initialized (constructed) ... Can we call constructor of superclass directly without using super()method in subclass? if yes,explain,if no,why? How could I, in C++ declare a class point. The class point has two private data members x and y of type float. The class point has a parameterized constructor to initialize both the data members i.e. x and y. The class point has a member function display() that display the value of x and y. Create two objects p1 and p2 with your desired data and display the values of x and y of p1 and p2. Now create a third object p3 by using the expression p3=p1+p2 and display the values of x and y of p3. Read Answers (1) | Asked by : attique Latest Answer : The answer is when instantiating an object compiler needs a correct object type. If the constructor is declared virtual then the the object type can not be resolved at compile time, and that's why it is not possible to declare a constructor as virtual. ... Read Answers (4) | Asked by : gaurav Latest Answer : It can be better explained in this way also.Thumb Rule When a copy constructor is called ? : when any object is created and it is being initialized with otherObject of same type Copy constructor is called. Blv me this is is only one way how copy ... Read Answers (2) | Asked by : preetha varma
Sponsored Links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||