If you want to use global variable i of file1.c in file2.c, then below are the points to remember:
main function shouldn't be there in file2.c
now global variable i can be shared with file2.c by two ways:
a) by declaring with extern keyword in file2.c i.e extern int i;
b) by defining the variable i in a header file and including that header file in file2.c.