我在使用C語言時輸入:(旁邊行號方便看,沒打上去的) 01#include <studio.h> 02 03int main(void) 04{ 05 printf( "C語言的世界,你好啊!!"); //利用printf()輸出一行字 06 return 0; 07 }
卻一直無法執行 DEV-C++說問題在07: [Error]expected’;’before ‘}’token
請問是什麼意思? 該怎麼修正?
謝謝
已邀請的邦友 {{ invite_list.length }}/5
ideone
1 .
你的標點符號都是全形?!
應該是要用半形唷
2 .
然後你應該要的是
#include <stdio.h>
而不是
#include <studio.h>
除非 studio.h 是你自己寫的或是引用進來的
雖然在這就算不include stdio.h 也能使用 printf
但還是建議include會比較好
參考
原來已經有人回答了.
我有處理了 #include <stdio.h>
int main(void) { printf("C 語言的世界, 你好啊!!"); // 利用 printf() 輸出一行字 return 0 }
他仍然顯示 E:\Example\Ch01\Ch01_02.c In function 'main': 7 1 E:\Example\Ch01\Ch01_02.c [Error] expected ';' before '}' token (謝謝你的回答)
這次換 return 0 的 ; 不見了
IT邦幫忙