How can I convert it? And I want the converted result to 1.
#include <iostream> #include <string> int main(int argc, const char * argv[]) { std::string s = "0x00"; // insert code here... unsigned char* str_hex = (unsigned char*)s.c_str(); unsigned char target = 0x00; std::cout << "result: " << (*str_hex == target) << "\n"; return 0; }