方法一:使用strncpy_s CString sendstr://sendstr中的内容来自编辑框,这里不再介绍将编辑框内内容更新到变量中的操作 char buf[100] = {};//是将sendstr中的内容拷贝到buf //以下两步是先将CString转为string,再由c_str()转为const char* string stra = CStringA(sendstr); strncpy_s(buf,_countof(buf...