Given the following:
&row->count
Would &(row->count) be evaluated or (&row)->count be evaluated in C++?
EDIT: Here's a great link for C++ precedence.
Given the following:
&row->count
Would &(row->count) be evaluated or (&row)->count be evaluated in C++?
EDIT: Here's a great link for C++ precedence.
This is already asked. But here is a link.
Edit: Ok this question is very similar. And possibly there is an other one.
-> has a higher priority than & (address of). So your expression would be evalutated as &(row->count)
As far as precedence rules go, I've always liked the one put forth by Steve Oualline in "Practical C":
There are fifteen precedence rules in C (&& comes before || comes before ?:). The practical programmer reduces these to two:
1) Multiplication and division come before addition and subtraction.
2) Put parentheses around everything else.
May I suggest that you resolve such questions using a test programme? That has the advantage that you will know for sure that the answer is correct for your implementation, and you are not exposed to the risk of badly answered questions.