#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;
^
なぜそうなのですか?