English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

請問我在Dec-C++4.9.9.25執行c語言之void main(void),compiler 壹值出現錯誤訊息?

2007-05-14 11:49:24 · 3 個解答 · 發問者 xxx 1 in 電腦與網際網路 程式設計

3 個解答

因為 Dev C++ 這個編譯器,它不接受 main 是 void 型態。
但是微軟的編譯器可以接受 main 是 void 型態。
你可以使用下面的程式碼!
#include
#include
int main(int argc, char* argv[]){
//…程式敘述
system("PAUSE");
return 0;
}

2007-05-14 14:45:07 · answer #1 · answered by Big_John-tw 7 · 0 0

你要用cout就需要#include
要用printf就需要#include
至於你編譯錯誤
就是你include沒找到函式庫
或是你打錯字

2007-05-15 08:37:12 · answer #2 · answered by 茄子熊 2 · 0 0

因為void main(void)是錯的
main的return型態規定為int

2007-05-14 13:27:15 · answer #3 · answered by novus 6 · 0 0

fedest.com, questions and answers