1 2 3 4 5 6 7 8 9 10
int main() { stringstream ss("0x123"); ss.seekg(0); int x = 0; ss >> hex; if (ss >> x) { cout << hex << x; } }
1
123