Namespaces
Variants
Views
Actions

std::stof, std::stod, std::stold

From cppreference.com
< cpp‎ | string‎ | basic string
Revision as of 17:46, 2 July 2011 by P12 (Talk | contribs)

Template:cpp/string/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <string>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td >
float       stof( const std::string& str, size_t *idx = 0, int base = 10);
</td>

<td > (1) </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">

<td >
double      stod( const std::string& str, size_t *idx = 0, int base = 10);
</td>

<td > (2) </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">

<td >
long double stold( const std::string& str, size_t *idx = 0, int base = 10);
</td>

<td > (3) </td> <td > Template:mark c++0x feature </td> </tr> Template:ddcl list end

Template:params
str - the string to convert
idx - address of integer to store index of first unconverted character
base - the number base

Template:returns The string converted to the specified floating point type.

Template:see also

Template:cpp/string/dcl list stoi