为什么下面的程序给我一个声明错误?我不是在那个特定的行声明它吗?
#include <iostream>
#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<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