The void type specifier is primarily used to explicitly declare functions that return no value. It is also used to create void pointers (pointers to void), which are generic pointers that are capable of pointing to any type of object.
In C, void is also used to declare an empty parameter list in a function declaration.
|Programming Tip|| |
A class that contains at least one pure virtual function is called abstract. Abstract classes cannot be used to instantiate objects. They also cannot be used as function parameter types or as return types. However, you can create a pointer to an abstract class.
A class that inherits an abstract class and does not override all of the pure virtual functions will, itself, be abstract. A derived class must override all pure virtual functions of all of its base classes before the derived class becomes concrete and objects of its class can be created.