Note precedence of dereference and class-member operator 

Forum: U Chicago, Com Sci 221, autumn 2000
Re: News Take-home midterm exam, due 6 November (Mike O'Donnell)
Re: Question About the last problem in the Mid-term (Zhenglong Gu)
Date: 2000, Nov 09
From: Michael C. Brizic <m-brizic@uchicago.edu>

I think Prof. O'Donnell was correct in using parentheses in midterm problem number 5 when he wrote:

(*B[i]).first

I referenced my "On To C++" book by Patrick Henry Winston, 1995, and he mentions that the class-member operator has higher precedence than the dereference operator.

If *B[i].first is used, then it is equivalent to saying:

*(B[i].first)


Messages

to: "precedence of dereference and class-member operator"