C++11 added some new string conversion functions:
http://en.cppreference.com/w/cpp/string/basic_string/stoul
It includes stoi (string to int), stol (string to long), stoll (string to long long), stoul (string to unsigned long), stoull (string to unsigned long long). Notable in its absence is a stou (string to unsigned) function. Is there some reason it is not needed but all of the others are?
related: No "sto{short, unsigned short}" functions in C++11?
The most pat answer would be that the C library has no corresponding “
strtou”, and the C++11 string functions are all just thinly veiled wrappers around the C library functions: Thestd::sto*functions mirrorstrto*, and thestd::to_stringfunctions usesprintf.Edit: As KennyTM points out, both
stoiandstolusestrtolas the underlying conversion function, but it is still mysterious why while there existsstoulthat usesstrtoul, there is no correspondingstou.