I am working with 64bit hex strings and, when I want to have the number in uint64_t, if the number is higher than 7f... it will not convert the number correct. Since I'm not english, i think i can show the problem better with a piece of code:
void testing()
{
std::string str = "cba321456789654a";
uint64_t res = std::strtol(str.c_str(), NULL, 16);
cout << "RESULT " << std::hex << res << endl;
}
And the result I'm getting is:
RESULT 7fffffffffffffff
Do I have to change the type of my variables to a bigger int? Or there is a way to solve this problem using uit64_t?