程序代码:
#include <stdio.h>
int main (void)
{
int n = 10;
printf ("Initially, n = %d\n", n);
for (int n = 1; n < 3; n++)
printf ("loop 1: n = %d\n", n);
printf ("After loop 1, n = %d\n", n);
for (int n = 1; n < 3; n++)
{
printf ("loop 2 index n = %d\n", n);
int n = 30;
printf ("loop 2: n = %d\n", n);
n++;
}
printf ("After loop 2, n = %d\n", n);
system ("pause");
return 0;
}
我用 gcc -std=c99 -o 12_forc99.exe 12_forc99.c出现
12_forc99.c: In function 'main':
12_forc99.c:19:2: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
system ("pause");
^
这样的错误提示,把system ("pause");注销后一切正常,这句话有什么问题吗?为什么编译无法通过?