Referring to the following code:
#include <stdio.h>
int a;
int a;
int main()
{
int b;
int b;
return 0;
}
Why does the compiler (GCC) complain about re-declaring only for variable "b" and not "a"?
redef.c: In the function "main": redef.c: 19: error: fixing "b" without binding
redef.c: 18: error: previous declaration 'b' was here
source
share