title: error: ‘Class’ was not declared in this scope
body: <p>I would like to ask, how can I define class inside another one.  In the code below. I try to define it in the way   #define "CCompField.h" ,but it doesn't work. :(.
  I think that it is very common programming problem, probably it was 100000 times solved on the internet, but I don't know how to find it. Thanks for help.</p>
  
  <pre><code>#ifndef CNEWGAME_H
  #define CNEWGAME_H
  
  class CNewGame{
      public:
                 CNewGame();
                ~CNewGame();
  
          void  BeginnerGame();
          void  IntermediateGame();
          void  AdviceGame();
          void  HowToPlay();
          void  NetGame( int mode );
  
  
          int MoveInMenu();
  
      protected:
          void  Intro();
          void  Animation ();
          void  Menu(int);
           int  MoveInNetMenu();
          void  NetMenu(int);
  
          void  HeadOfGame();
  template &lt;class T&gt; void BodyOfGame(CCompField &amp; b, T &amp; a);
          void  FooterOfGame();
  };
  
  #endif
  </code></pre>
  
  <p>It makes following errors.</p>
  
  <pre><code>In file included from src/CNewGame.cpp:12:0:
  src/CNewGame.h:37:36: error: ‘CCompField’ was not declared in this scope
  src/CNewGame.h:37:45: error: ‘b’ was not declared in this scope
  src/CNewGame.h:37:50: error: expected primary-expression before ‘&amp;’ token
  src/CNewGame.h:37:52: error: ‘a’ was not declared in this scope
  src/CNewGame.h:37:53: error: variable or field ‘BodyOfGame’ declared void
  </code></pre>