我不明白为什么这不起作用。谢谢!为什么这个代码不工作?
#include<stdio.h>
#include<conio.h>
int main()
{
extern int i;
int i=20;
printf("%d",i);
}
编译结果中出现以下错误:
main.c: In function 'main':
main.c:6:9: error: declaration of 'i' with no linkage follows extern declaration
main.c:5:16: note: previous declaration of 'i' was here
注:代码在CompileOnline
* How *不起作用?你得到编译错误?链接器错误?运行时错误? –