![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Sep 2004
Posts: 29
Rep Power: 0
![]() |
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. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|