Conver HEX file to integer array

Status
Not open for further replies.

abdoalghareeb

Member level 5
Joined
Feb 5, 2010
Messages
84
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Visit site
Activity points
1,981
I have this text file which has HEX values for some small image(16X16).
I want a code to read these values from the text file and convert them to integer array (int array_name[x]).
Later I want to send this array to micro controller.

I use C++ Builder 6

View attachment text.txt
 

You'll do this by copying (or including) the text to your code and changing char type to int.
 

I see
But I need that code for access to the text file
(for example if I load the file to Memo1 ,
I have to start from line 7 and read the character for each HEX number after that make converting ...... )
 

The file uses C-syntax and can be read by any C-compiler at compile time. If you want to read it by your own tool for some reason, you can write a parser by using C string functions.
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…