1
我想用C++类,但每当我尝试编译时,出现此错误:C++错误代码C1004
“致命错误C1004:意外的结束文件中找到”
我正在使用VS2010。微软的文档(http://msdn.microsoft.com/en-us/library/4exw7xyc(v = vs.80).aspx)说这个错误是由于丢失大括号,分号等造成的。但是我可以看到从代码突出显示所有大括号匹配,并且我相信如果您缺少分号,您会收到通知。
class HashTable {
protected:
int HighValue;
char** AddressTable;
int* Table;
public:
HashTable(){
HighValue = 0;
}
~HashTable(){
delete AddressTable;
delete Table;
}
void AddPair(char* address, int value){
AddressTable[HighValue] = address;
Table[HighValue] = value;
HighValue += 1;
}
int GetValue(char* address){
for (int i = 0; i<HighValue; i++){
if (AddressTable[HighValue] == address) {
return Table[HighValue];
}
}
//If the value doesn't exist throw an exception to the calling program
throw 1;
};
}
谢谢,固定它。 – user1296991 2012-03-28 02:48:20
只要我看到我知道的代码的第一行... GCC给出了不同的东西。 @ user1296991,如果答案解决了您的问题,请单击它旁边的复选标记以接受答案。这是一个多层次的双赢局面。 – chris 2012-03-28 02:54:44