To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 1905
1904  |  1906
Subject: 
Somewhat C challenged.
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Wed, 9 Apr 1997 22:51:19 GMT
Original-From: 
victor w clark <kvclark@juno.&AntiSpam&com>
Viewed: 
1403 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 (...) (27 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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR