This example also illustrates function overloading. A reference is like a constant pointer that doesn't need to be de-referenced. Storage Allocation Global variables are defined outside of any enclosing curly braces. Global variables are available anywhere in your program. To use in a different file, use extern to declare.
Global variables have memory allocated at the start of program execution.
Global variables are generally a bad idea. Automatic variables are those defined within some set of curly braces. It retains its value over function calls. Functions are always global. Just make sure a function prototype, or definition, appears before the function's use.