다음을 통해 공유


stod

Converts a character sequence to a double.

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

매개 변수

Parameter

설명

_Str

The character sequence to be converted.

_Idx

The index value of the first unconverted character.

반환 값

double 값

설명

The function converts the sequence of elements in _Str to a value _Val of type double as if by calling strtod(_Str.c_str(), _Eptr), 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.

요구 사항

헤더: <string>

네임스페이스: std

참고 항목

참조

열(C++ STL <열>)

wstring

<string>