: Suppose we have declared a static variable or function in one of the source files and now we wish to use same variable or function in other source file, how do we use this?
You can't. The whole purpose of static variables is to block other files from using them.
You must do like this, which is also good programming practice:
/* myfile.h */
int getMyVar (void);
/* myfile.c */
static int myVar;
int getMyVar (void)
/* main.c */