当前位置:网站首页>std::stoi stol stoul stoll stof stod

std::stoi stol stoul stoll stof stod

2022-04-23 18:52:00 Brick Porter

std::stoi stol stoul stoll stof stod A series of functions are C++ Conversion provided string/wstring Methods , But for the second parameter, what the Internet says is from the second N A place to start , It's not , I don't know if this has been tested . This actually returns the number of digits , such as 1 Back to you 1,10 Back to you 2 100 Back to you 3. In addition, when the conversion fails, it will be abnormal. Be sure to deal with , Instead of atoi This C When the function conversion fails, it will return 0 The routine .

版权声明
本文为[Brick Porter]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210603257310.html