Global Variables
Global variable: a variable that is declared outside the scope of any class or function.
int top = 0; // global variable, top of stackint data[100]; // data area for stackint push(int val) { data[++top] = val; }int pop() { return data[top--]; }
Can be declared static and accessible only within the file in which they are declared.