In this code snippet, the stack is defined as global variable, because it needs to be accessible to all other functions.