Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Precedence

Status
Not open for further replies.

Aadithyan

MIS
Sep 4, 2007
1
DE
When shift has higher precedence than &, can anybody please explain why parentheses are required in the following statement?

X = (Y >> 1) & 0x000a;

 
Because not everybody can recite the entire precedence table from memory.

So for the sake of a couple of extra characters, people choose to be specific, to remove any doubt as to what is going on.

What do you mean by "required" ?
You've tried some code with and without, and got different answers?


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top