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


Please Help Members By Posting Answers For Below Questions

What is a c++ object?

721


Can I create my own functions in c++?

702


Why is null pointer used?

790


What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required

670


What is the basic of c++?

711






What do you mean by global variables?

681


Explain the difference between c++ and java.

745


What is static in c++?

697


Explain the difference between new() and malloc() in c++?

724


What is time_t c++?

688


What does h mean in maths?

671


Explain polymorphism?

680


Where is atoi defined?

660


Explain about vectors in c ++?

685


What is fixed in c++?

662