H
huey_jiang
Hi All,
I am trying to figure out a right syntax to convert an integer array
into hex array. sprintf worked for me on doing single integer:
int i, Iarray[8], n=15;
char buf[9];
sprintf(buf, "0x%02x", n);
The above code worked. Howeve, what I am trying to do is to convert an
array. I tried the following syntax, no good:
for (i=0; i<9; i++) sprintf(buff, "0x%02x", Iarray);
for (i=0; i<9; i++) sprintf(buff + i, "0x%02x", Iarray);
Anybody can help? Thanks a lot!
Huey
I am trying to figure out a right syntax to convert an integer array
into hex array. sprintf worked for me on doing single integer:
int i, Iarray[8], n=15;
char buf[9];
sprintf(buf, "0x%02x", n);
The above code worked. Howeve, what I am trying to do is to convert an
array. I tried the following syntax, no good:
for (i=0; i<9; i++) sprintf(buff, "0x%02x", Iarray);
for (i=0; i<9; i++) sprintf(buff + i, "0x%02x", Iarray);
Anybody can help? Thanks a lot!
Huey