title: c++ create a class exception
body: <p>I'm having trouble creating a simple class exception.</p>
  
  <p>Basically, I have to throw an exception if my number of score on a golf game is 0, because the method decreases the score by 1.</p>
  
  <p>How would I create a simple exception class in this case?</p>
  
  <p>My current code looks like this, but I'm stuck, I erased everything.</p>
  
  <pre><code>//looking for when score[i]=0 to send error message 
  class GolfError:public exception{
    public:
      const char* what(){}
      GolfError(){}
      ~GolfError(void);
  
    private:
      string message;
  };
  </code></pre>