Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

for 迴圈

#include <stdio.h>

#include <stdlib.h>

int mian(void)

{

int i,j;

for(i=1;i<6;i++){

for(j=0;j<i;j++){ //有問題

printf("*");

}

printf("\n");

}

system("pause");

return 0;

}

-----> [Linker error] undefined reference to `WinMain@16' ld returned 1 exit status

不知道為什麼,無法編譯。我是看李啟龍c的書本的例子作的,請問有誰可以告訴我complier到底error在那裏?

3 Answers

Rating
  • 1 decade ago
    Favorite Answer

    第3行mian改成main即可....

    Source(s): 自己
  • ㄚ旺
    Lv 5
    1 decade ago

    你的程式根本沒打錯.只是少打一行

    在程式最下面加一行

    int main(){return mian();}

    就可以了

  • 1 decade ago

    main 打成 mian 了...

Still have questions? Get your answers by asking now.