How to avoid a class from instantiation?
Answer Posted / chandrakant
make the class Abstract it will not be instantiated
and the pure virtual function is used to avoid the base call
function to be get called if we make a function as virtual
only a derived class function will get called
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are guid? Why does com need guids?
What is long in c++?
Explain the pure virtual functions?
What is ios :: in in c++?
Why do we need function?
What is a c++ object?
What are the various access specifiers in c++?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero
What is lambda in c++?
What is a node class in c++?
What is the difference between reference and pointer?
What is class in c++ with example?
What size is allocated to the union variable?
What is pointer in c++ with example?