c++????????????
???????????? ???????[ 2016/11/29 10:44:16 ] ????????.NET ?????
?????????????????c++???????????????????????????????????
????1.string vs char*
????//string to char*
????string str;
????const char* cch = str.c_str();
????char *ch = new char[strlen(cch)+1];
????strcpy(ch??cch);
????//char* to string
????string str = ch;
????2.string vs CString
????//CString to string
????CString cstr;
????string str = CStringA(cstr);
????//string to CString
????CString cstr = CString(str.c_str());
????3.CString vs char*
????//CString to char*
????CString cstr;
????int len = WideCharToMultiByte(CP_ACP?? 0?? cstr?? -1?? NULL?? 0?? NULL?? NULL);
????char *ch = new char[len + 1];
????WideCharToMultiByte(CP_ACP?? 0?? cstr?? -1?? ch?? len?? NULL?? NULL);
????//char* to CString
????CString cstr = CString(ch);
????4.int vs string
????//????c++11????????stoi??stof??stol??to_string??????????string???????
????//string to int
????string str = “111”;
????int i = stoi(str);
????//int to string
????string str = to_string(i);
?????????????????????????е??????????Ч??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11