/* Example for stack variables * Godmar Back , Spring 2005 */ /* compile with g++ stack.cc -o stack */ #include int a; static int b; int c = 5; struct S { int t; } s; void func(int d) { static int e; int f; struct S w; int *g = new int[10]; /* insert code here that prints the addresses of * a, b, c, s, s.t, d, e, f, w, w.t, g, g[0], and func * following this example: */ printf ("&a = %p\n", &a); } int main() { func(5); }