Created
August 6, 2014 09:29
-
-
Save DamonHao/49057ee439c82894d6ba to your computer and use it in GitHub Desktop.
converting Hex string to unsigned long
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <sstream> | |
| #include <iostream> | |
| int main() | |
| { | |
| std::string s("0xFFF000"); | |
| unsigned long value; | |
| std::istringstream iss(s); | |
| iss >> std::hex >> value; | |
| std::cout << value << std::endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment