Reputation: 35255
I have 2 files:
file1.c:
static int k = 3;
file2.c
int k = 5
Is there any way to access the extern variable k inside file2.c?
Upvotes: 0
Views: 147
Reputation: 1
Any variable is declared as a static variable, it can be accessed only with in a file or function. even if you declare extern int k also it cannot be accessed.
Upvotes: 0
Reputation: 363567
No, there is not. You should rename either one of your variables.
Upvotes: 3