I am trying to access a static variable from other file the following way. Can you please help in printing the value of variable 'c' in file1.c.
Find the code below
File1.c
void main(void)
{
int m;
m=func_ret();
printf("\n m = %d\n",m);
}
File2.c
static int c =5;
int *func_ret(void)
{
printf("\n c = [%d]\n",c);
return &c;
}