Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

to_wstring

 

Converts a value to a wide string.

wstring to_wstring(int Val);
wstring to_wstring(unsigned int Val);
wstring to_wstring(long Val);
wstring to_wstring(unsigned long Val);
wstring to_wstring(long long Val);
wstring to_wstring(unsigned long long Val);
wstring to_wstring(float Val);
wstring to_wstring(double Val);
wstring to_wstring(long double Val);

Parameter

Description

Val

The value to be converted.

The wide string that represents the value.

The function converts Val to a sequence of elements stored in an array object Buf internal to the function as if by calling swprintf(Buf, Len, Fmt, Val), where Fmt is

  • L"%d" if Val has type int

  • L"%u" if Val has type unsigned int

  • L"%ld" if Val has type long

  • L"%lu" if Val has type unsigned long

  • L"%lld" if Val has type long long

  • L"%llu" if Val has type unsigned long long

  • L"%f" if Val has type float or double

  • L"%Lf" if Val has type long double

The function returns wstring(Buf).

Requirements

Header: <string>

Namespace: std

Show:
© 2016 Microsoft