Monday, 9 September 2013

Read contents of a file as hex in C

Read contents of a file as hex in C

I have a file with hex values saved as hex.txt which has
9d ff d5 3c 06 7c 0a
Now I need to convert it to a character array as
char hex[] = {0x9d,0xff,0xd5,0x3c,0x06,0x7c,0x0a}
How do I do it ?

No comments:

Post a Comment