title: Class C++ Error : "Virtual is not allowed"
body: <p>I have this header for a project I'm doing :</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;exception&gt;
  using namespace std;
  
  class InvalidException : public exception
  {
  private:
      string message; 
  
  public:
  
  
      InvalidException(const char *message)
      {
          this-&gt;message = message;
      }
  
  
      virtual const char *catch_the_error const throw()
      {
          return this-&gt;message.c_str();
      }
  };
  </code></pre>
  
  <p>And it says that virtual is not allowed here and I don't know why because my exception is made public. Can somebody please provide me an answer please ?</p>