title: C++ error: expected unqualified-id before '-' token
body: <p>I am following an SDL tutorial and have run across a problem. When I compile my program, it gives the errors </p>
  
  <pre><code>/home/cevent.h 9 error: expected unqualified-id before '-' token
  /home/cevent.cpp 5 error: expected unqualified-id before '-' token
  </code></pre>
  
  <p>My code is as follows:</p>
  
  <p>The Header file</p>
  
  <pre><code>//cevent.h
  #ifndef CEVENT_H
  #define CEVENT_H
  
  #include &lt;SDL/SDL.h&gt;
  
  class CEvent {
  public:
      CEvent();
      virtual -CEvent();
      void onEvent(SDL_Event *event);
      virtual void onExit();
      //and various other virtual method declarations
  };
  
  #endif // CEVENT_H
  </code></pre>
  
  <p>And the source file</p>
  
  <pre><code>//cevent.cpp
  #include "cevent.h"
  
  CEvent::CEvent() {}
  
  CEvent::-CEvent() {}
  
  void CEvent::onEvent(SDL_Event *event) {
      switch(event-&gt;type) {
          //some code for handling events
      }
  }
  //some temporarily empty method definitions
  </code></pre>
  
  <p>I have dug through multiple online solutions to similar problems, but i can neither find one that satisfies my problem nor work out the solution based on what i have read.</p>