What is Abstract Class and Pure virtual function?

I am a college student who is trying his hands in coding , open to learning new tech stuff.
So I lost some marks in the same question in my College Exams so this motivated me to know about this topic and it might just help you, This is a very short article about Abstract Class and Pure virtual function, give this just a glance.
ABSTRACT CLASS : It is the class we declare with a sole purpose to be used as a Base class . Some important points regarding Abstract class:-
- A class will be abstract if it has at least one pure virtual function.
- We have to override pure virtual function in derived class otherwise derived class also becomes Abstract class.
- Abstract class can have constructors.
PURE VIRTUAL FUNCTION: Syntax:
class Test (//this class is also abstract class)'
{
public:
virtual void show() = 0; (//this is the declaration of pure virtual class remember "=
0" this is the only difference between virtual class and pure virtual class )
};
If we use pure virtual function You "have to" declare the function otherwise program will not compile it is not the case with normal virtual function as it doesn't throw ay error if we don't elaborate on the function this is a major difference between pure and normal virtual function.




