I have two C files 1.c and 2.c
2.c
#include<stdio.h>
static int i;
int func1(){
   i = 5;
   printf("\nfile2 : %d\n",i);
   return 0;
}
1.c
#include<stdio.h>
int i;
int main()
{
   func1();
   printf("\nFile1: %d\n",i);
   return 0;
}
I compiled both the files with "gcc 1.c 2.c -o st" The output is as follows
file2 : 5
File2: 0
I was expecting output as follows
file2 : 5
File2: 5
I want to access the same variable "i" in both the files. How can I do it?