cstrings collection conversion cstrings string may want to add the relevant header files, CT2A it defined in the "atlconv. H" Cstrings file1.
The string filename.
CT2A xx (file1);
Filename=xx;
turn cstrings char * Cstrings strRootPath;
USES_CONVERSION;
Char * chRootPath=T2A (strRootPath);
turn cstrings int Int MinSize=_ttoi (cstrings cst_MinSize);
turn cstrings float Cstrings str_data;
Float f_data;
f_data=https://bbs.csdn.net/topics/_tstof (str_data);
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */
string conversion collection
turn char * string Char * p=(char *) (strpath. C_str ())
string turn float String str_data="https://bbs.csdn.net/topics/12345";
Float f_data;
F_data=https://bbs.csdn.net/topics/atof (str_data c_str ());
string turn int Int n=atoi (STR) c_str ());
CodePudding user response:
Thank you for your share
CodePudding user response:
String those things: BSTR - LPSTR - LPWSTR - cstrings - VARIANT - COleVariant - _variant_t CComBSTR - _bstr_t
http://blog.csdn.net/pizi0475/archive/2010/03/04/5346708.aspx
CodePudding user response:
If I remember correctly, T2A seems to have a length limit, 1024, had better turn WCHAR * char * or use WideCharToMultiByte () function
CodePudding user response: