std::stoul, std::stoull
Min standard notice:
Header: <string>
Interprets an unsigned integer value in the string str.
# Declarations
unsigned long stoul ( const std::string& str,
std::size_t* pos = nullptr, int base = 10 );
(since C++11)
unsigned long stoul ( const std::wstring& str,
std::size_t* pos = nullptr, int base = 10 );
(since C++11)
unsigned long long stoull( const std::string& str,
std::size_t* pos = nullptr, int base = 10 );
(since C++11)
unsigned long long stoull( const std::wstring& str,
std::size_t* pos = nullptr, int base = 10 );
(since C++11)
# Parameters
str: the string to convertpos: address of an integer to store the number of characters processedbase: the number base
# Return value
The string converted to the specified unsigned integer type.
# Example
This section is incompleteReason: no example
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 2009 | C++11 | std::out_of_range would not be thrown ifstd::strtoul or std::strtoull sets errno to ERANGE | will throw |