- 2
- 0
- 约9.79千字
- 约 21页
- 2017-06-05 发布于河南
- 举报
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
您可能关注的文档
最近下载
- 课题申报书:新时代无党派代表人士问题研究.docx VIP
- 高中语文课标2025修订解读PPT课件.pptx VIP
- 企业合同法及合同纠纷解决概述.pptx VIP
- 2024湖南环境生物职业技术学院招聘笔试真题带答案详解.docx VIP
- FURUNO古野OZS23780B_FCV1150使用说明书.pdf
- 合同纠纷解决案例分析成功解决合同纠纷的策略与技巧.pptx VIP
- 2024年湖南环境生物职业技术学院招聘笔试真题带答案详解.docx VIP
- 2026年流动式起重机司机证模拟考试题库及答案.doc VIP
- 2024湖南环境生物职业技术学院招聘笔试真题带答案详解.docx VIP
- 2024年全国职业院校技能大赛高职组(建筑装饰数字化施工赛项)备赛试题库(含答.docx VIP
原创力文档

文档评论(0)