Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


Converts a character sequence to an unsigned long long.

unsigned long long stoull(
    const string& _Str, 
    size_t *_Idx = 0,
    int _Base = 10
unsigned long long stoull(
    const wstring& _Str, 
    size_t *_Idx = 0,
    int _Base = 10




The character sequence to be converted.


The index value of the first unconverted character.


The number base to use.

The unsigned long long value.

The function converts the sequence of elements in _Str to a value _Val of type unsigned long long as if by calling strtoull(_Str.c_str(), _Eptr, _Base), where _Eptr is an object internal to the function. If _Str.c_str() == *_Eptr it throws an object of type invalid_argument. If such a call would set errno, it throws an object of type out_of_range. Otherwise, if _Idx is not a null pointer, the function stores *_Eptr - _Str.c_str() in *_Idx and returns _Val.

Header: <string>

Namespace: std

Community Additions

© 2015 Microsoft