c++各种数据类型之间相互转化(国外英文资料).docVIP

  • 2
  • 0
  • 约9.79千字
  • 约 21页
  • 2017-06-05 发布于河南
  • 举报

c++各种数据类型之间相互转化(国外英文资料).doc

c各种数据类型之间相互转化(国外英文资料)

c++各种数据类型之间相互转化 Translation: char * to BSTR BSTR b = _com_util: : ConvertStringToBSTR ( data ); SysFreeString (bstrValue); (2).bstr converts to char * Char * p = _com_util: : ConvertBSTRToString (b); The delete p; Typedef and typename keywords The two key words are confusing at the time of application, but its very simple, typedef is the type definition, And typename is the type of interpretation of the 20th of April 2009 Type conversion is a conversion of a type of value to a value of another type This is a common problem in actual code writing, which is a string and other types of transformations Turn the string into a whole (1). The transformation function / / double precision function Double atof ( Const char * string ); Double _wtof ( Const wchar_t * string ); The adaptive TCHAR: _tstof, _ttof VS2005: _atof_l, _wtof_l, _atodbl, _atodbl_l / / integer function Int atoi ( Const char * string ); _int64 _atoi64 ( Const char * string ); Int _wtoi ( Const wchar_t * string ); _int64 _ wtoi64 ( Const char * string ); The adaptive TCHAR: _tstoi, _ttoi, _tstoi64, _ttoi64 VS2005: _atoi_l, _wtoi_l, _atoi64_l / / long plastic function Long atol ( Const char star string ); Long _wtol ( Const wchar_t * string ); The adaptive TCHAR: _tstoi, _ttoi VS2005: _atoi_l, _wtoi_l Reference: /s/blog_413570100b0d9.ht ml (2).code reference Cstring ting = 1234; Int num = atoi (ting); The value of num is 1234. CString ting = 1234; Double num = atof (ting); The final result: the num value is 1234.0000000000000 2.int is converted into a string Cahr * _itoa The 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 ( The 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 ); The meaning of the parameter: value is the whole thing that is meant to be

文档评论(0)

1亿VIP精品文档

相关文档