[ create a new paste ] login | about

Link: http://codepad.org/hEKAZFM4    [ raw code | output | fork ]

C++, pasted on Jul 21:
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;
   }
}


Output:
1
123


Create a new paste based on this one


Comments: