Grah

This is a discussion on Grah within the C Programming forums, part of the General Programming Boards category; This was soo annoying to track down I thought I'd come out of retirement to post it. printf("%02hhX\n", 4-7); What ...

  1. #1
    Evil Member
    Join Date
    Jan 2002
    Posts
    638

    Grah

    This was soo annoying to track down I thought I'd come out of retirement to post it.

    printf("%02hhX\n", 4-7);

    What should that print out?

  2. #2
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,157
    FFFD according to Borland 5.5 and Turbo 1.0
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    From C99 standard:
    hh Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
    signed char or unsigned char argument (the argument will have
    been promoted according to the integer promotions, but its value shall be
    converted to signed char or unsigned char before printing); or that
    a following n conversion specifier applies to a pointer to a signed char
    argument.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

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