parsing Hexadecimal
Opened this issue · 1 comments
babbutycoon commented
How do I parse hexadecimal numbers?
gghati commented
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;
}