Write a syntax or code for abstract class?

All QuestionsCategory: Cpp LanguageWrite a syntax or code for abstract class?
Chetan Shidling Staff asked 5 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 5 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
}
};