It is not necessary to to declare variables inside the function
in C. If you declare a variable inside a function, the variable
becomes local for the function and another variable of same name
can be declared in any other function, but you can not use the
variable declared in other function. When you declare any variable
outside the function body then the variable becomes global and can
be used in any function of the program.
Note: errno is an example for a variable declared outside any
function.