This is probably a dumb question but I am still learning so here goes....
I have a requirement to concatenate two elements of an array.
For example:
array[0] = "f";
array[1] = "e";
newarray[0] = "0x"+array[0]+array[1]
array[0] = "f";
array[1] = "e";
newarray[0] = "0x"+array[0]+array[1]
To copy to clipboard, switch view to plain text mode
so the result would be "0xfe"
I have tried
char result[10];
char buffer[10];
sprintf( result[0] , "0x%c%c", (unsigned int) buffer[0], (unsigned int) buffer[1]);
char result[10];
char buffer[10];
sprintf( result[0] , "0x%c%c", (unsigned int) buffer[0], (unsigned int) buffer[1]);
To copy to clipboard, switch view to plain text mode
which compiled but gave a segmentation error when run.
Any thoughts or suggestions would be greatly appreciated.
Thanks, B1.
Bookmarks