If i define a global variable in a .c file, how can i use the value of the same variable in another .c file?
.c
file1.c
#incl
Use the extern keyword to declare the variable in the other .c file. E.g.:
extern
extern int counter;
means that the actual storage is located in another file. It can be used for both variables and function prototypes.