Subject:
|
Somewhat C challenged.
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Wed, 9 Apr 1997 22:51:19 GMT
|
Original-From:
|
victor w clark <{kvclark@juno.com}Spamless{}>
|
Viewed:
|
2398 times
|
| |
 | |
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
|
|
Message has 1 Reply:  | | 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 (...) (29 years ago, 10-Apr-97, to lugnet.robotics.handyboard)
|
2 Messages in This Thread:   
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|