Thread: Masking

  1. #1
    Registered User
    Join Date
    Sep 2002


    I have a piece of equipment that returns a status bit in the form of an ASCII character. I want to logical & this status bit with the number 1 in order to detect a change in the least significant bit.

    I'm not having much success, can anybody help.

    Many thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    if ( ch & 1 ) {
      // do stuff
    Like so?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL and 2D Masking
    By dxfoo in forum Game Programming
    Replies: 7
    Last Post: 03-08-2008, 01:00 PM
  2. understand masking bits
    By musikluvah in forum C++ Programming
    Replies: 2
    Last Post: 02-03-2006, 11:31 PM
  3. drive masking
    By bennyandthejets in forum Windows Programming
    Replies: 5
    Last Post: 09-19-2003, 01:48 PM
  4. DIB masking
    By SAMSAM in forum Windows Programming
    Replies: 1
    Last Post: 02-03-2003, 10:22 AM
  5. Masking a surface
    By malloc(BOB) in forum Windows Programming
    Replies: 0
    Last Post: 09-05-2002, 12:49 PM