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 is the c++ programming language used for?
What is a dangling pointer in c++?
What is nested class in c++?
Write a function to find the nth item from the end of a linked list in a single pass.
What happens if a pointer is deleted twice?
Explain the uses of static class data?
Is C++ case sensitive a) False b) Depends on implementation c) True
What is iterator c++?
Is there a sort function in c++?
Explain queue. How it can be implemented?
Describe private, protected and public?
How to declare a function pointer?
Why do we use classes in c++?
What is a storage class used in c++?
What is #include cmath?