title: C++ error: expected initialiser before 'class'
body: <p>When I compile the program I am working on I get:</p>
  
  <blockquote>
    <p>expected initializer before 'class'</p>
  </blockquote>
  
  <p>error in my <code>Class.h</code> file. I looked up the error message on the internet, but couldn't find the exact error, although similar errors seem to be caused by missing semicolons but I don't see why I need one. This is the code the error points to, I have no other functions or classes before it.</p>
  
  <pre><code>class Account
  {
      public:
      double dAccountBalance;
  
      double dAccountChange(double dChange);
  };
  </code></pre>
  
  <p>In the <code>Class.cpp</code> file the <code>double dAccountChange(double dChange)</code> function is defined. I don't think this is where the error is coming from but this is the code;</p>
  
  <pre><code>double Account::dAccountChange(double dChange)
  {
      dAccountBalance += dChange;
  
      return 0.0;
  }
  </code></pre>
  
  <p>When I change the code in Class.h to look like this,</p>
  
  <pre><code>;
  class Account
  {
      public:
      double dAccountBalance;
  
      double dAccountChange(double dChange);
  };
  </code></pre>
  
  <p>it doesn't generate an error message, but I can't work out why I need the semicolon before it as the only code I have before it are the following pre-processor lines.</p>
  
  <pre><code>#ifndef CLASS_H_INCLUDED
  #define CLASS_H_INCLUDED
  </code></pre>
  
  <p>Any ideas on why the error is generated?</p>