visual c++ 的一個問題

程式碼是這樣 內容我隨便打的

然後錯誤訊息是在下面 不太懂這是什麼意思

// Firstone.cpp : Defines the entry point for the application.

//

#include <iostream.h>

int main()

{

int a;

cout <<\"請問你?\";

cin>>a;

if(a>6)

cout <<\"oh yeah you are health!\\n\";

else if(6>a>3)

cout <<\"o you are right\\n\";

else if(a<0)

cout <<\"that is impossible\\n\";

else

cout <<\"you have to eat more\\n\";

return 0;

}

錯誤訊息

Compiling...

Firstone.cpp

c:\\program files\\microsoft visual studio\\myprojects\\firstone\\firstone.cpp(21) : fatal error C1010: unexpected end of file while looking for precompiled header directive

Error executing cl.exe.

Firstone.exe - 1 error(s), 0 warning(s)

3 Answers

Rating
  • 1 decade ago
    Favorite Answer

    else if(6>a>3)這是錯誤的,應該改成else if(a<6 && a>3)  //&&是和的意思在C++中不能用6>a>3

    2006-05-12 21:15:56 補充:

    你把#include <iostream.h>改成#include <iostream>然後再加上using namespace std;這行試試看

  • pfg
    Lv 4
    1 decade ago

    在你的project perperty->compiler options->precompile header option 把他改成不使用precompile header

  • 1 decade ago

    找不到header檔啦 (應該是......... "#include <iostream>" .)

    找不到header檔啦 (應該是......... "#include <iostream>" .)

    找不到header檔啦 (應該是......... "#include <iostream>" .)

Still have questions? Get your answers by asking now.