I have int a[]
in one C file. Now in another .c file I have extern int *a
.
I need to know what will be the behavior if I try to access variable a
in second file and why?
What all problems would occur?
I have int a[]
in one C file. Now in another .c file I have extern int *a
.
I need to know what will be the behavior if I try to access variable a
in second file and why?
What all problems would occur?
Undefined behaviour. So anything might happen.
If you include the file(declaration) twice or declared variable named a, then there may be error redefinition of a;
when i tried the above compiler shows error :
conflicting types for a;
//previous definition in other file...