C ++ data type conversion skills

Source: Internet
Author: User

1. Convert the string to an integer:

Function category:

Double atof (const char * string );

Double _ wtof (const wchar_t * string );

Int atoi (const char * string );

_ Int64 atoi (const char * string );

Int _ wtoi (const wchar_t * string );

_ Int64 _ wtoi64 (const wchar_t * string );

Long atol (const char * string );

Long _ wtol (const wchar_t * string );

 

 

2. convert other data types to strings

Function category:

2.1 int to string:

Char * _ ITOA (INT value, char * string, int Radix );

Char * _ i64toa (_ int64 value, char * string, int Radix );

Char * _ ui64toa (unsigned _ int64 value, char * string, int Radix );

Wchar_t * _ itow (INT value, wchar_t * string, int Radix );

Wchar_t * _ i64tow (_ int64 value, wchar_t * string, int Radix );

Wchar_t * _ ui64tow (unsigned _ int64 value, wchar_t * string, int Radix );

 

2.2 long to a string:

Char * ltoa (long value, char * string, int Radix );

Wchar_t * ltow (long value, wchar_t * string, int Radix );

 

2.3 double conversion to a string:

Char * _ fcvt (double value, int count, int * Dec, int * sign );

 

 

 

Related Article

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.