How does 0xff get represented on a 16 bit machine?

This is a discussion on How does 0xff get represented on a 16 bit machine? within the C Programming forums, part of the General Programming Boards category; If I have something like 0xff on a 16 bit machine, would it look like 0000 0000 1111 1111 In ...

  1. #1
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329

    How does 0xff get represented on a 16 bit machine?

    If I have something like 0xff on a 16 bit machine, would it look like

    0000 0000 1111 1111

    In other words, would there be leading zeros in front of 1111 1111 ?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Yes.
    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.

  3. #3
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329
    Got it. Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 16 bit or 32 bit
    By Juganoo in forum C Programming
    Replies: 9
    Last Post: 12-19-2002, 06:24 AM
  2. 32 bit or 16 ???
    By GiraffeMan in forum C Programming
    Replies: 11
    Last Post: 04-24-2002, 12:56 PM
  3. 16 Bit Compiler
    By Jperensky in forum C Programming
    Replies: 5
    Last Post: 03-29-2002, 02:08 PM
  4. 16 bit colors
    By morbuz in forum Game Programming
    Replies: 13
    Last Post: 11-10-2001, 12:49 AM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM

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