std::stoul, std::stoull

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

# Return value

The string converted to the specified unsigned integer type.

# Example

This section is incompleteReason: no example

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 2009C++11std::out_of_range would not be thrown ifstd::strtoul or std::strtoull sets errno to ERANGEwill throw

# See also