More My solution for problem 5 (l- and r-values) 

Forum: U Chicago, Com Sci 221, autumn 2000
Re: News Take-home midterm exam, due 6 November (Mike O'Donnell)
Re: Ok Good grades for midterm exam (Mike O'Donnell)
Date: 2000, Nov 09
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

Here's my solution for Problem #5. I am happy with lots of variations in the style. The crucial thing is to mention precisely the right l-values and r-values in the right order.

*C[i] = (*B[j]).first
  1. dereference l(j) to r(j)
  2. calculate l(B[j]) from l(B) and r(j)
  3. dereference l(B[j]) to r(B[j])
  4. l(*B[j]) = r(B[j])
  5. calculate l((*B[j]).first) from l(*B[j])
  6. dereference l((*B[j]).first) to r((*B[j]).first)
  7. dereference l(i) to r(i)
  8. calculate l(C[i]) from l(C) and r(i)
  9. dereference l(C[i]) to r(C[i])
  10. l(*C[i]) = r(C[i])
  11. store r((*B[j]).first) at the address l(*C[i])



Mike O'D.


to: "My solution for problem 5 (l- and r-values)"