string to char ( but not char* )

if string contains 0xAB hex value, how can i store it in char array (at one of the location ) such that char[specific location] contains 0xAB as it is.
Last edited on
array[dst_index] = string[src_index];
string s_low = 0xAB;
unsigned char ch;
ch = s_low; --> error: cannot convert 'std::string {aka std::basic_string<char>}' to 'unsigned char' in assignment
Last edited on
Interesting how what you wrote looks nothing like what I wrote.
if string contains 0xAB hex value
How? does it contain four characters '0 'x' 'A' 'B'? Or its first character has value of 0xAB?
Topic archived. No new replies allowed.