#include <sstream> #include <iostream> int main() { unsigned int x; std::stringstream ss; ss << std::hex << "ABC"; ss >> x; // output it as a signed type std::cout << static_cast<int>(x) << std::endl; }
C++中字符串(16进制)转为10进制
猜你喜欢
转载自blog.csdn.net/hguo11/article/details/52766978
今日推荐
周排行