Question: what is difference between extern and global?
Answer: Keyword extern is present exactly for the same reason. You can tell the name and type of variable followed by extern which means this variable is present in one of the (possibly current) compilation unit which will be resolved (linked) at link time. Global talks about the visibility of a variable (or function).