std::stof, std::stod, std::stold
From cppreference.com
Template:cpp/string/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<string>
<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
This section is incomplete |
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.