stoll

将字符序列转换为 long long。

long long stoll(
    const string& _Str, 
    size_t *_Idx = 0,
    int _Base = 10
);
long long stoll(
    const wstring& _Str, 
    size_t *_Idx = 0,
    int _Base = 10
);

参数

Parameter

说明

_Str

将转换的字符序列。

_Idx

第一个没有重字符的索引值。

_Base

使用的数基。

返回值

long long 值。

备注

函数将元素的序列。_Str 的转换类型 long long 的值 _Val,就象通过调用 strtoll(_Str.c_str(), _Eptr, _Base),_Eptr 是内部一的对象传递给函数。如果 _Str.c_str() == *_Eptr 会引发类型 invalid_argument对象。如果这样的调用将设置 errno,会引发类型 out_of_range对象。否则,因此,如果 _Idx 不是null指针,*_Idx 的函数存储 *_Eptr - _Str.c_str() 和返回 _Val。

要求

标头: <string>

命名空间: std

请参见

参考

string (<string>)

wstring

<string>