In C language, I want to access a global static variable outside the scope of the file . Let me know the best possible way to do it. One of the methods is to assign an extern global variable the value of static variable,
In file a.c
static int val=10; globalvar =val;
In file b.c
extern globalvar ;
But in this case any changes in val(file a.c) will not be updated in globalvar in (file b.c) .
Please let me know how can I achieve the same
Thanks, Sikandar.