How to convert a 64-bit integer to a wide string

Source: Internet
Author: User

The solution is as follows:

 

1. First, use sprintf to convert to char * (for security consideration, use springf_s or snprintf)

2. Use multibytetowidechar to convert the converted string to a wide character (UNICODE)

 

Note that for non-int64 types, you can use wsprintf () to directly format the data into a wide character set. However, wsprintf does not support 64-bit integer types.

 

CodeSample:

 

Char buff [1024];

Securezeromemory (buff, sizeof (buff ));

 

 

Sprintf (buff, format, source );

 

Wchar_t Dest [1024];

Multibytetowidechar (cp_acp, 0, buff,-1, DEST, 1024 );

 

For more information about functions, see msdn 2008.

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.