共用方式為


stold

將字元序列轉換成 long double。

double stold(
    const string& _Str, 
    size_t *_Idx = 0
);
double stold(
    const wstring& _Str, 
    size_t *_Idx = 0
);

參數

參數

描述

_Str

要轉換的字元序列。

_Idx

第一個未轉換字元的索引值。

傳回值

long double 值。

備註

函式轉換項目的序列。 _Str 的成員型別 long double 的值 _Val ,就像是藉由呼叫 strtold(_Str.c_str(), _Eptr), _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>