title: How to fix C++ error: expected unqualified-id
body: <p>I'm getting this error on line 6:</p>
  <blockquote>
  <pre><code>error: expected unqualified-id before '{' token
  </code></pre>
  </blockquote>
  <p>I can't tell what's wrong.</p>
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class WordGame;
  {               // &lt;== error is here on line 6
  public:
  
      void setWord( string word )
      {
          theWord = word;
      }
      string getWord()
      {
          return theWord;
      }
      void displayWord()
      {
          cout &lt;&lt; &quot;Your word is &quot; &lt;&lt; getWord() &lt;&lt; endl;
      }
  private:
      string theWord;
  }
  
  
  int main()
  {
      string aWord;
      WordGame theGame;
      cin &gt;&gt; aWord;
      theGame.setWord(aWord);
      theGame.displaymessage();
  
  }
  </code></pre>