View Single Post
  #2   Spotlight this post!  
Unread 12-01-2004, 19:47
jeremy562 jeremy562 is offline
Engineer
#0562 (SPARK 562)
 
Join Date: Feb 2002
Location: Fitchburg, MA
Posts: 74
jeremy562 is an unknown quantity at this point
Send a message via AIM to jeremy562
Re: Logical And Bitwise AND

Quote:
Originally Posted by SeanCassidy
I was looking over the default code, and was confused on one part. Here is the code:
Code:
relay1_fwd = p1_sw_trig & rc_dig_in01;  /* FWD only if switch1 is not closed. */
Now knowing regular C, I would say & is bitwise AND. But then I saw the comment above it, "The & used below is the C symbol for AND." And I wasn't sure anymore if it was logical or bitwise AND. Could someone clarify for me?
It's the symbol for bitwise AND. Logical AND in C is always &&.
__________________
SPARK 562: Students Pursuing Applied Robotics Knowledge

2006 BAE Granite State Regional: Finalists with 319 and 176
2006 BAE Granite State Regional: Winners of Motorola Quality Award
2004 BAE Granite State Regional: 7th Seed
2004 Mayhem on the Merrimack Champions! Thanks, 61 and 1289!