Namespaces
Variants
Views
Actions

std::to_wstring

From cppreference.com
< cpp‎ | string‎ | basic string
Revision as of 09:43, 2 November 2012 by P12bot (Talk | contribs)

 
 
 
std::basic_string
 

Template:ddcl list begin <tr class="t-dsc-header">

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

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

<td >
std::wstring to_wstring( int value );
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( long value );
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( long long value );
</td>

<td > (3) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( unsigned value );
</td>

<td > (4) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( unsigned long value );
</td>

<td > (5) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( unsigned long long value );
</td>

<td > (6) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( float value );
</td>

<td > (7) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( double value );
</td>

<td > (8) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
std::wstring to_wstring( long double value );
</td>

<td > (9) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

1) Converts a signed decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%d", value) would produce for sufficiently large buf.
2) Converts a signed decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%ld", value) would produce for sufficiently large buf..
3) Converts a signed decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%lld", value) would produce for sufficiently large buf.
4) Converts an unsigned decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%u", value) would produce for sufficiently large buf.
5) Converts an unsigned decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%lu", value) would produce for sufficiently large buf.
6) Converts an unsigned decimal integer to a wide string with the same content as what std::swprintf(buf, sz, L"%llu", value) would produce for sufficiently large buf.
7,8) Converts a floating point value to a wide string with the same content as what std::swprintf(buf, sz, L"%f", value) would produce for sufficiently large buf.
9) Converts a floating point value to a wide string with the same content as what std::swprintf(buf, sz, L"%Lf", value) would produce for sufficiently large buf.

Contents

Parameters

value - a numeric value to convert

Return value

a wide string holding the converted value

Example

double f = 23.43;	
std::wstring f_str = std::to_wstring(f);


See also

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