Skip to content

Latest commit

 

History

History
55 lines (50 loc) · 6.35 KB

data-conversion.md

File metadata and controls

55 lines (50 loc) · 6.35 KB
descriptiontitlems.datef1_keywordshelpviewer_keywords
Learn more about: Data Conversion
Data Conversion
03/21/2018
c.conversions
data conversion routines [C++]
converting data

Data conversion

These routines convert data from one form to another. Generally these routines execute faster than conversions you might write. Each routine that begins with a to prefix is implemented as a function and as a macro. See Recommendations for choosing between functions and macros for information about choosing an implementation.

Data-conversion routines

RoutineUse
absFind absolute value of integer
atof, _atof_lConvert string to float
atoi, _atoi_lConvert string to int
_atoi64, _atoi64_lConvert string to __int64 or long long
atol, _atol_lConvert string to long
c16rtomb, c32rtombConvert UTF-16 or UTF-32 character to equivalent multibyte character
_ecvt, _ecvt_sConvert double to string of specified length
_fcvt, _fcvt_sConvert double to string with specified number of digits following decimal point
_gcvt, _gcvt_sConvert double number to string; store string in buffer
_itoa, _ltoa, _ultoa, _i64toa, _ui64toa, _itow, _ltow, ultow, _i64tow, _ui64tow, _itoa_s, _ltoa_s, _ultoa_s, _i64toa_s, _ui64toa_s, _itow_s, _ltow_s, _ultow_s, _i64tow_s, _ui64tow_sConvert integer types to string
labsFind absolute value of long integer
llabsFind absolute value of long long integer
_mbbtombc, _mbbtombc_lConvert 1-byte multibyte character to corresponding 2-byte multibyte character
_mbcjistojms, _mbcjistojms_l, _mbcjmstojis, _mbcjmstojis_lConvert Japan Industry Standard (JIS) character to Japan Microsoft (JMS) character
_mbcjistojms, _mbcjistojms_l, _mbcjmstojis, _mbcjmstojis_lConvert JMS character to JIS character
_mbctohira, _mbctohira_l, _mbctokata, _mbctokata_lConvert multibyte character to 1-byte hiragana code
_mbctohira, _mbctohira_l, _mbctokata, _mbctokata_lConvert multibyte character to 1-byte katakana code
_mbctombb, _mbctombb_lConvert 2-byte multibyte character to corresponding 1-byte multibyte character
mbrtoc16, mbrtoc32Convert multibyte character to equivalent UTF-16 or UTF-32 character
mbstowcs, _mbstowcs_l, mbstowcs_s, _mbstowcs_s_lConvert sequence of multibyte characters to corresponding sequence of wide characters
mbtowc, _mbtowc_lConvert multibyte character to corresponding wide character
strtod, _strtod_l, wcstod, _wcstod_lConvert string to double
strtol, wcstol, _strtol_l, _wcstol_lConvert string to long integer
strtoul, _strtoul_l, wcstoul, _wcstoul_lConvert string to unsigned long integer
strxfrm, wcsxfrm, _strxfrm_l, _wcsxfrm_lTransform string into collated form based on locale-specific information
toascii, __toasciiConvert character to ASCII code
tolower, _tolower, towlower, _tolower_l, _towlower_l, _mbctolower, _mbctolower_l, _mbctoupper, _mbctoupper_lTest character and convert to lowercase if currently uppercase
tolower, _tolower, towlower, _tolower_l, _towlower_lConvert character to lowercase unconditionally
toupper, _toupper, towupper, _toupper_l, _towupper_l, _mbctolower, _mbctolower_l, _mbctoupper, _mbctoupper_lTest character and convert to uppercase if currently lowercase
toupper, _toupper, towupper, _toupper_l, _towupper_lConvert character to uppercase unconditionally
wcstombs, _wcstombs_l, wcstombs_s, _wcstombs_s_lConvert sequence of wide characters to corresponding sequence of multibyte characters
wctomb, _wctomb_l, wctomb_s, _wctomb_s_lConvert wide character to corresponding multibyte character
_wtof, _wtof_lConvert wide-character string to a double
_wtoi, _wtoi_lConvert wide-character string to int
_wtoi64, _wtoi64_lConvert wide-character string to __int64 or long long
_wtol, _wtol_lConvert wide-character string to long

See also

Universal C runtime routines by category

close