Question: what is the difference between global variable and extern variable in c?
Answer: If a variable is global, you can access it in any compilation unit (commonly called source file, module etc.) If a variable is defined globally, there should be a way to tell compiler about possible global variables (or functions) that we may encounter. Keyword extern is present exactly for the same reason.