Write a syntax or code for abstract class?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Cpp LanguageWrite a syntax or code for abstract class?
Chetan Shidling Staff asked 6 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 6 years ago

Abstract Class

class chetan       //abstract base class
{
private:
data-type d1;
data-type d2;
public:
virtual void spec()=0;     //pure virtual class
};

class A : public chetan
{
public:
void spec()
{
//A definition….
}
};

class B : public chetan
{
public:
void spec()
{
//B definition
}
};

class C : public chetan
{
public:
void spec()
{
//C definitions
}
};