PDA

View Full Version : difficulty in conversion



mohanakrishnan
7th December 2009, 06:34
hi all
im creating a qt application that stores hexadecimal values in the database.
like 12aede23eacbaadf. So from the application i need to send the some protocol.
The protocol is obviously a character array (ie.,char proto[20])
so in the protocol ,i have to mention the hexavalues,into the character array..like below

proto[0]=0x12;
proto[1]=0xae;
proto[2]=0xde;
proto[3]=0x23;
proto[4]=0xea;
proto[5]=0xcb;
proto[6]=0xaa;
proto[7]=0xdf;

i have tried, many ways ..can any one help me??
any help is highly respected...
thanks :crying::crying:

vieraci
7th December 2009, 07:00
0x is converting to hex, NOT CHAR.

mohanakrishnan
7th December 2009, 07:57
hi vieraci
yes i want to convert from string into hex ,but what i meant is ,it should be stored in a char array...
thanks....
:)

vieraci
7th December 2009, 11:31
You will have to write your own function to do this.