Thread: hexadecimal to ascii

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    8

    hexadecimal to ascii

    Hi everyone....

    Does anyone know of a function in C to converto from hexadecimal to ascii and from ascii to hexadecimal????

    Thanks

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    sprintf, sscanf, assuming "to ASCII" actually has some real meaning.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Try this.
    Code:
    #include <stdio.h>
    
    int main(void)
    {
       unsigned char ascii = 0x32;
       
       printf("hex: %02X\n", ascii);
       printf("ascii: %u\n", ascii);
       return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ASCII convert to Hexadecimal value?
    By ashish.malviya in forum C Programming
    Replies: 2
    Last Post: 04-05-2006, 12:45 AM
  2. Replies: 11
    Last Post: 03-24-2006, 11:26 AM
  3. Office access in C/C++ NOT VC++!! :)
    By skawky in forum C++ Programming
    Replies: 1
    Last Post: 05-26-2005, 01:43 PM
  4. ascii values for keys
    By acid45 in forum C Programming
    Replies: 2
    Last Post: 05-12-2003, 07:13 AM
  5. Checking ascii values of char input
    By yank in forum C Programming
    Replies: 2
    Last Post: 04-29-2003, 07:49 AM