decimal ascII character

This is a discussion on decimal ascII character within the C Programming forums, part of the General Programming Boards category; hello. i know i can use printf( "\xHH" ); to print an ascII character, in HH hex number. But, how ...

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    6

    decimal ascII character

    hello.
    i know i can use printf( "\xHH" ); to print an ascII character, in HH hex number.
    But, how can i do it using a number in decimal format? something like that: printf( "\DDD" ); and DDD is a decimal number.

    Regards
    Thanks

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,682
    I don't think there is one to do that with the escape sequences at least as far as I know. May be other might know. But you could type cast it like this as well:

    Code:
    printf("%c", 65);
    which is a standard procedure used!!

    ssharish

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    6
    thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Character to Ascii
    By tdep in forum C Programming
    Replies: 6
    Last Post: 07-10-2006, 03:07 PM
  2. about wide character and multiple byte character
    By George2 in forum C Programming
    Replies: 3
    Last Post: 05-22-2006, 08:11 PM
  3. Problem with loop stopping at wrong time
    By Baron in forum C Programming
    Replies: 11
    Last Post: 12-14-2005, 07:35 PM
  4. HEEEELP: Letters to ASCII decimal equivalents?
    By Mazerius in forum C++ Programming
    Replies: 7
    Last Post: 10-30-2002, 08:56 AM
  5. Replies: 1
    Last Post: 07-31-2002, 10:49 AM

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