GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 29-Sep-2006, 03:59
Kennice Low Kennice Low is offline
New Member
 
Join Date: Sep 2006
Posts: 1
Kennice Low is on a distinguished road

How to convert from Ascii to Hexadecimal in C program


Hi Gurus,

May I know who to convert value from Ascii to Hexadecimal?

Example:

ABC to 41 42 43

Thank you.

best regards,
Kennice
  #2  
Old 29-Sep-2006, 05:30
niek_e niek_e is offline
Junior Member
 
Join Date: Sep 2006
Posts: 39
niek_e is on a distinguished road

Re: How to convert from Ascii to Hexadecimal in C program


i didn't try this, but you could use printf or sprintf.

CPP / C++ / C Code:
char cA = 'a';
char acB[10];

sprintf(acB, "%x", cA);


or something like that?
Last edited by LuciWiz : 29-Sep-2006 at 05:55. Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
  #3  
Old 29-Sep-2006, 10:30
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,435
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: How to convert from Ascii to Hexadecimal in C program


See this information
__________________

Definition: Politics
Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C program to convert NFA to DFA ayoub C Programming Language 11 14-Sep-2007 14:51
Pipeline freeze simulation darklightred C++ Forum 6 27-Jul-2006 19:37
A program to convert miles to kilometres Persian_Devil13 C Programming Language 23 03-Feb-2006 22:57
how to convert binary file to hexadecimal file? banur22 C++ Forum 6 29-Apr-2005 07:27

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:20.


vBulletin, Copyright © 2000 - 2014, Jelsoft Enterprises Ltd.