hexadecimal is a representation of a number (integer) in a string.
ss << hex << str_pc;
ss >> dec >> temp_pc;
This does not make sense. The hex
modifier in the first line does not work on strings, so is useless here. On the other hand on the second line you use a int
so there you should put the hex
modifier to make the string in the buffer interpreted as a hexadecimal number;
ss << str_pc;
ss >> hex >> temp_pc;