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 are the operators in c++?
What are the differences between the function prototype and the function defi-nition?
Can a program run without main in c++?
Why is c++ so fast?
Explain the concept of dynamic allocation of memory?
what is data abstraction in C++?
What is prototype for that c string function?
What does int * mean in c++?
How do you initialize a string in c++?
What are static member functions?
Write a program which uses Command Line Arguments
What is the best c c++ compiler for windows?
Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h
When can I use a forward declaration?
Can you overload the operator+ for short integers?