In class handout


Consider the following functions and main:

void t() { int m; }
void f() { int r; double s; int z; }
void q(int x) { }

int main() {
  int x;
  int z;

  t();
  f();
  q(z);
  
  return 0;
}



What does the following do?  Draw the picture and learn.

int *crazy(int x, int *p) {
  int z = 3;
  *p = z;
  p = &x;
  x = 4;
  return p;
}

int main() {
  int *q;
  int k = 5, j = 2;
  q = crazy(j, &k);
}