看板 Programming 關於我們 聯絡資訊
※ 引述《Jer1983 (stanley)》之銘言: : 以下是課本的範例 : #include <stdio.h> : #define NAME "MEGATHINK, INC." : #define ADDRESS "略" : #define PLACE "略" : #define LIMIT 65 : void starbar(void); : int main(void) : { : starbar(); /*印出一排星星*/ : printf("%s\n", NAME); /*印出NAME*/ : printf("%s\n", ADDRESS); /*印出ADDRESS*/ : printf("%s\n", PLACE); /*印出PLACE*/ : starbar(); /*最後再印出一排星星*/ : return0; : } : void starbar(void) /* 本函式的功能是印出一排星星 !!! */ : { : int count; : for(count=1;count<=LIMIT;count++) : putchar('*'); : putchar('*'); : } : 我的問題是, 在main(void){...}中starbar()被使用了兩次, 為什麼? : 課本上寫第二次的功能為/*use the function*/, 那第一次的功能是? 謝謝 這樣應該就很清楚了吧 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.213.158
Jer1983:thanks a lot! 124.8.232.117 02/16 22:00