1、VC 中数字与字符串转换方法字符串转数字1CRT 函数ASCII UNICODE TCHAR VS2005int atoi _wtoi _tstoi_ttoi_atoi_l_wtoi_llong atol _wtol _tstoi_ttoi_atoi_l_wtoi_l_int64 _atoi64 _wtoi64 _tstoi64_ttoi64_atoi64_l_wtoi64_lfloat _atoflt_atoflt_ldouble atof _wtof _tstof_ttof_atof_l_wtof_l_atodbl_atodbl_llong double_atoldbl_atoldbl_l
2、2.使用 sscanf3.Windows SDK: :StrToInt4.MFC/ATL:CString:Format (此函数应该是用来将数字转成字符, MSDN 中有解释)数字转字符串1.CRT 函数 ASCII UNICODE TCHAR VS2005int itoa_itoa_itow _itot long ltoa_ltoa_ltow _ltot _int64 _i64toa _i64tow _i64tot double gcvt_gcvt_ecvt_fcvt_wtof _tstof_ttof_gcvt_s_ecvt_s_fcvt_s2.使用 sprintf3.:StringCbPr
3、intf通用相互转换方法1.C+流方式:stringstream 2.boost 库:boost: lexical_cast摘自 MSDN:Data-Conversion RoutinesRoutine Useatof, _atof_l, _wtof, _wtof_l Convert string to floatatoi, _atoi_l, _wtoi, _wtoi_l Convert string to int_atoi64, _atoi64_l, _wtoi64, _wtoi64_l Convert string to _int64atol, _atol_l, _wtol, _wtol_
4、l Convert string to long_ecvt, _ecvt_s Convert double to string of specified length_fcvt, _fcvt_s Convert double to string with specified number of digits following decimal point_gcvt, _gcvt_s Convert double number to string; store string in buffer_itoa, _i64toa, _ui64toa, _itow, _i64tow, _ui64tow,_
5、itoa_s, _i64toa_s, _ui64toa_s, _itow_s, _i64tow_s, _ui64tow_sConvert int or _int64 to string_ltoa, _ltow, _ltoa_s, _ltow_s Convert long to stringstrtod, _strtod_l, wcstod, _wcstod_l Convert string to doublestrtol, wcstol, _strtol_l, _wcstol_l Convert string to long integerstrtoul, _strtoul_l, wcstou
6、l, _wcstoul_l Convert string to unsigned longinteger_ultoa, _ultow, _ultoa_s, _ultow_s Convert unsigned long to stringatof, _atof_l, _wtof, _wtof_l Convert wide-character string to adoubleatoi, _atoi_l, _wtoi, _wtoi_l Convert wide-character string to int_atoi64, _atoi64_l, _wtoi64, _wtoi64_l Convert wide-character string to_int64atol, _atol_l, _wtol, _wtol_l Convert wide-character string