iT邦幫忙

1

C語言 問題

我在使用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

請問是什麼意思?
該怎麼修正?

謝謝

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

1
dragonH
iT邦超人 5 級 ‧ 2019-06-30 14:48:54
最佳解答

ideone

1 .

你的標點符號都是全形?!

應該是要用半形唷

2 .

然後你應該要的是

#include <stdio.h>

而不是

#include <studio.h>

除非 studio.h 是你自己寫的或是引用進來的

雖然在這就算不include stdio.h 也能使用 printf

但還是建議include會比較好

參考

看更多先前的回應...收起先前的回應...
小魚 iT邦大師 1 級 ‧ 2019-06-30 15:12:48 檢舉

原來已經有人回答了.

我有處理了
#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
(謝謝你的回答)

dragonH iT邦超人 5 級 ‧ 2019-06-30 15:16:21 檢舉

/images/emoticon/emoticon25.gif

dragonH iT邦超人 5 級 ‧ 2019-06-30 15:16:47 檢舉

這次換 return 0 的 ; 不見了

我要發表回答

立即登入回答