| | Somewhat C challenged.
|
| Please excuse my bitwise ignorance. Could someone explain this statement to me. if (4 & peek(0x1000)) what does peek(0x1000) return? what is the 4 for ? and what does the "&" compare? thanks victor (27 years ago, 9-Apr-97, to lugnet.robotics.handyboard)
| | | | Re: Somewhat C challenged.
|
| Victor, The peek(0x1000) statement returns the byte at memory location 1000 (hex). In C, the '&' operator is a bitwise AND. So, what you are doing is ANDing 4 and the contents of 0x1000. What's really going on is you are interested in only bit 3 (...) (27 years ago, 10-Apr-97, to lugnet.robotics.handyboard)
| |