R
Rahul
Hi Everyone,
I wanted to know if the following declaration is valid?
extern int i = 10;
#include <cstdio>
int main()
{
printf("%d\n",i);
}
I get the following warning,
warning: `i' initialized and declared `extern'
I expected an error, as extern by itself indicates that the variable
is defined in some other compilation unit...
I wanted to know if the following declaration is valid?
extern int i = 10;
#include <cstdio>
int main()
{
printf("%d\n",i);
}
I get the following warning,
warning: `i' initialized and declared `extern'
I expected an error, as extern by itself indicates that the variable
is defined in some other compilation unit...