Share
Explore BrainMass

global variable

The parameter list is the normal means to supply values to a function. Global variables are an alternate means for a function to have access to values. Describe what a global variable is, how it is declared, and then discuss the pros and cons of combining global variables and functions.

Solution Preview

Global variables are the variables that has the global scope i.e. they can be accessed from any function that the program comprises. These variables are declared outside all the function definitions including the main() function and are accessible from the place of declaration till the end of the program. And any changes made to these variables remain consistent ...

Solution Summary

Describe what a global variable is, how it is declared, and then discuss the pros and cons of combining global variables and functions.

$2.19