Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/string/basic string/to string"

From cppreference.com
< cpp‎ | string‎ | basic string
(See also: fix template link)
(use correct sidebar)
Line 1: Line 1:
 
{{cpp/title|to_string}}
 
{{cpp/title|to_string}}
{{cpp/string/sidebar}}
+
{{cpp/string/basic_string/sidebar}}
 
{{ddcl list begin}}
 
{{ddcl list begin}}
 
{{ddcl list header | string}}
 
{{ddcl list header | string}}

Revision as of 10:53, 12 September 2011

Template:cpp/string/basic 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 >
std::string to_string( int value );
</td>

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

<td >
std::string to_string( long value );
</td>

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

<td >
std::string to_string( long long value );
</td>

<td > (3) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
std::string to_string( unsigned value );
</td>

<td > (4) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
std::string to_string( unsigned long value );
</td>

<td > (5) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
std::string to_string( unsigned long long value );
</td>

<td > (6) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
std::string to_string( float value );
</td>

<td > (7) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
std::string to_string( double value );
</td>

<td > (8) </td> <td > Template:mark c++11 feature </td> </tr> <tr class="t-dcl ">

<td >
std::string to_string( long double value );
</td>

<td > (9) </td> <td > Template:mark c++11 feature </td> </tr> Template:ddcl list end

1-3) Converts a signed decimal integer to a string in the style [-]dddd. At least one digit is written.

4-6) Converts a unsigned decimal integer to a string in the style dddd. At least one digit is written.

7-9) Converts a floating point value to a string in the style ddd.ddd. At least Template:cpp digits are written after the decimal point character.

Contents

Parameters

value - a numeric value to convert

Return value

a string holding the converted value

Example

Template:example cpp

See also

Template:cpp/string/basic string/dcl list to wstring