Masking

This is a discussion on Masking within the C Programming forums, part of the General Programming Boards category; I have a piece of equipment that returns a status bit in the form of an ASCII character. I want ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    12

    Masking

    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
    Bazzz

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,855
    Code:
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 02: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, 01:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21