Example of using global and local variables
Implementing a stack
Suppose we want to implement a
stack
of
integers
Program organization:
Use a
global
int
array
to represent the
stack
Use a
global variable
to represent the
stack top (index)
Define a
push( )
function
Define a
pop( )
function