title: C++ Class Declaration
body: <p>Why does the following program give me an declaration error?
  Aren't I declaring it at that specific line?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #define MILLION 1000000
  
  using namespace std;
  
  class BitInt
  
  {
    public:
      BigInt();
  
    private:
      int digit_array[MILLION];
      int length;
  };
  
  BigInt::BigInt()
  {
      int length=0;
      for(int i=0; i&lt;MILLION; i++)
          digit_array[i]=0;
  }
  
  int main()
  {
      BigInt();
  
      return 0;
  }
  
  bigint.cpp:11: error: ISO C++ forbids declaration of ‘BigInt’ with no type
  bigint.cpp:18: error: ‘BigInt’ has not been declared
  bigint.cpp:18: error: ISO C++ forbids declaration of ‘BigInt’ with no type
  bigint.cpp: In function ‘int BigInt()’:
  bigint.cpp:22: error: ‘digit_array’ was not declared in this scope
  </code></pre>