Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Sep 7th, 2005, 11:53 AM   #1
JawaKing00
Newbie
 
Join Date: Sep 2004
Posts: 29
Rep Power: 0 JawaKing00 is on a distinguished road
Converting ANSI characters to hex for Checksum.

Ok, I've been working with embedded C for too long and am too accustomed to using hexidecimal by default.

I'm trying to write a small piece of code that will read a .hex file and compute a 16 bit checksum of the contents. The problem I'm having is that I can't seem to figure out how to get C to read the characters in the file as hex numbers and not ANSI characters.

Ultimately I want the program to grab a pair of characters (aka one byte) and then add all of them together and display the result as a hex number.

Basically how can I tell the program that "01" = 16, "FF" = 255, etc. ?

Thanks in advance for the help.
JawaKing00 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:24 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC