In computer programming, an external variable is a variable that is declared outside any function. Contrary to popular belief, this does not necessarily make the variable global. In programming languages such as C and C++, the scope of an external variable begins at its point of declaration, and ends at the end of its module, or source file.