Defining and accessing global variables in memory