The following piece of code working fine:
#include <stdio.h>
extern int foo; // Without constant
int foo = 42;
int main()
{
printf("%d\n",foo);
return 0;
}
But, the following piece of code give an error:
#include <stdio.h>
const extern int foo; // With constant
int foo = 42;
int main()
{
printf("%d\n",foo);
return 0;
}
So, why does const extern
give an error?