I am trying to use inheritance to create a class derived from runtime_error, but I keep getting an error even though this is the exact code used in exercises and as an example from the book. Here is the code:
class DivideZeroEx : public runtime_error
{
public:
DivideZeroEx()
runtime_error( " attempt to divide by zero" )
};
Now I get an error stating that it expects a ; before the runtime_error(“attempt to divide by zero”) line.
The syntax for calling your base class constructor should be: