When will a constructor executed?

Answer Posted / priya

Constructor gets called when we create an object,or when we
allocated memory using new operator:

void main()
{
test *t = new test;
delete t;
}

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 5 oop principles?

601


How to use CMutex, CSemaphore in VC++ MFC

4328


Why is polymorphism important in oop?

629


How is polymorphism achieved?

583


Which language is not a true object oriented programming language?

640






What is the difference between static polymorphism and dynamic polymorphism?

579


What do you mean by Encapsulation?

640


Advantage and disadvantage of routing in telecom sector

784


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1782


What is the use of oops?

619


Why do we need polymorphism in c#?

684


What is overloading and its types?

612


What is the highest level of cohesion?

577


Why do we use encapsulation in oops?

518


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

1637