ben-strasser / fast-cpp-csv-parser

fast-cpp-csv-parser
BSD 3-Clause "New" or "Revised" License
2.09k stars 435 forks source link

parsing Hexadecimal #90

Open babbutycoon opened 4 years ago

babbutycoon commented 4 years ago

How do I parse hexadecimal numbers?

gghati commented 4 years ago

You can use stringstream class as shown below:

include

include

int main() { unsigned int x;
std::stringstream ss; ss << std::hex << "fffefffe"; ss >> x; // output it as a signed type std::cout << static_cast(x) << std::endl; }