#include<stdio.h>
int check,check;
void main(){
printf("Hello!!");
}
当我编译这段代码时,一切正常,但是当我在主函数中给出这个时,
#include<stdio.h>
void main(){
int check,check;
printf("Hello!!");
}
我收到一个错误,例如
C:\MinGW\bin>cc ex1.c
ex1.c: In function 'main':
ex1.c:4:11: error: redeclaration of 'check' with no linkage
int check,check;
^
ex1.c:4:5: note: previous declaration of 'check' was here
int check,check;
^
为什么会这样?