以下代碼在C++下編譯時有問題:#include<stack>#include<iostream>#include<assert.h>using namespace std;int main(){ stack<int> S; S.push(8); S.push(7); S.push(7); S.push(4); assert(S.size()==3); assert(S.top()=4); cout<<S.top(); S.pop(); assert(S.top()==7); cout<<S.top(); S.pop(); assert(S.top()==8); cout<<S.top(); S.pop(); assert(S.empty()); reurn 0;}錯誤如下:fatal error C1010: unexpected end of file while looking for precompiled header directiveError executing cl.exe.¶þ·Ö·¨.exe - 1 error(s), 0 warning(s)請高手分析一下
熱心網友
可以包含一個不帶擴展名的頭文件嗎?stack S;這是什么意思?沒見過尖括號這么用的。錯誤提示的意思是,在重新編譯頭文件的時候,遇到意外的文件結尾。可能是頭文件寫的有錯。
熱心網友
我也是這樣的情況不知道怎么回事,學習下