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 12-Dec-2004, 17:52
jediboy jediboy is offline
New Member
 
Join Date: Dec 2004
Posts: 1
jediboy is on a distinguished road

Help with Decimal to Hex Conversions


Hi all,

I'm having trouble with this:

char *dec_to_hex(int dec_num)


I'm passing it an integer, (maximum of 255), and am looking to return a pointer to a character array with the HEX value. I'm not allowed to use any built in functions provided by C/C++ for the math conversion.

Can anyone out there help? Strictly character arrays, no strings.


Muchos gracias,
B.
  #2  
Old 13-Dec-2004, 01:11
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
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
Quote:
Originally Posted by jediboy
Hi all,

I'm having trouble with this:

char *dec_to_hex(int dec_num)


I'm passing it an integer, (maximum of 255), and am looking to return a pointer to a character array with the HEX value. I'm not allowed to use any built in functions provided by C/C++ for the math conversion.

Can anyone out there help? Strictly character arrays, no strings.


Muchos gracias,
B.
Welcome Oh Jedi one! The FORCE has all the answers, use it!

Based on what you posted, the problem you're having is: there ain't no code after your function declaration. It won't work without code...

Since we are not Jedi masters here, all you've told us is "I wanna" which implies "will you do it for me?"

We need to know
1) what you are having trouble with ("everything" is not an appropriate answer)
2) what you've done so far
3) why you think what you've done is wrong
if we're going to be able to help you.
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

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
Re: Conversion: Binary, Decimal, Hexadecimal WaltP C Programming Language 1 10-May-2006 07:49
Hex Result giving strange answers. Rosdahale C Programming Language 6 07-Dec-2004 21:28
problems typecasting an int to a string holbrook C++ Forum 9 07-May-2004 19:59

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

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


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