How to avoid a class from instantiation?
Answer Posted / vinay bondade
Have a Pure Virtual function in the class. This will not
allow to create an object of the class and hence cannot be
instatiated. But its a different thing to inherit the class
and give definition to Pure Virtual function, But the class
alone cannot be instantiated.The class hence,is also called
Abstract Base class.
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is an operator function? Describe the function of an operator function?
What is c strings syntax?
How can I improve my c++ skills?
Which one between if-else and switch is more efficient?
Is c++ the hardest programming language?
What is a wchar_t in c++?
What do you understand by a pure virtual member function?
What are the sizes and ranges of the basic c++ data types?
Will rust take over c++?
What is virtual destructor ans explain its use?
What are the different types of polymorphism in c++?
What is c++ & why it is used?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
How do you traverse a btree in backward in-order?
How did c++ start?