471,071 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

converting a string in a hexadecimal array

Hi,
i need help for a (maybe) simple function :). I need to send by serial port a series of hexadecimal bytes with a xor control character. The language i use could not work with hexadecimal and xor operation so i decide to create a dll with a simple function which takes a string and return me a string of hexadecimal number. I know how to comunicate and how to create the dll, but i dont know how to make the function in c or c++.

the input is a string of 22 character with spaces too.
the output is a string of 25 headecimal number (or 25 bytes to simplify) for example:
02h FF FF...22 bytes...FF 03H BCC
where 02h and 03h are const character and between them are the hex value of my input string (i use FF just to simply but it could be any char).
Last i have BCC that is the exadecimal Xor complement of the 24 characters before ,to be clear a control character ( 02^FF^FF...^03 = BCC).
I hope you could help me (sorry for my english :) ).
Apr 14 '07 #1
0 1496

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Sverre Bakke | last post: by
2 posts views Thread by Joel Moore | last post: by
15 posts views Thread by jaks.maths | last post: by
5 posts views Thread by Jeff Dillon | last post: by
7 posts views Thread by elliotng.ee | last post: by
6 posts views Thread by Andrea | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.