extern void func(void);
extern int i;
printf("i in main %d
printf("Call to func before modifying i in main...
printf("Call to func after modifying i in main to 66..
printf("i in func %c
i in main 65
Call to func before modifying i in main...
i in func A
Call to func after modifying i in main to 66..
i in func B
Why 'i' in main and file1 referring to same object? Why doesnt it give a link error saying undefined reference to 'i' as the types are conflicting though names are same.
If char i in were present in main itself, one would get complile error saying conflicting names.
Looking for a right explanation.