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: The std::sto*
functions mirror strto*
, and the std::to_string
functions use sprintf
.
Edit: As KennyTM points out, both stoi
and stol
use strtol
as the underlying conversion function, but it is still mysterious why while there exists stoul
that uses strtoul
, there is no corresponding stou
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…