【发布时间】:2020-10-14 18:12:45
【问题描述】:
我无法将 char * 转换为 CString.. 最后 2 行打印什么也不打印...我需要它作为 cstring 的一部分才能将其传递给函数..
char result[500];
strcpy(result, "\\\\.\\pipe\\");
strcat(result, a["BLOB"][i].GetString());// just appending to "result" a string I am reading from json file..
CString temp(result);
printf("\n1-The pipeName we are looking at is %s \n", result);
printf("\n2-The pipeName we are looking at is %s \n", temp);
printf("\n3-The pipeName we are looking at is %s \n", CString(result,500));
【问题讨论】:
-
什么是
CString,它来自哪里?它不是标准 C++ 的一部分。 -
在
CString和.GetString()之间,我假设这是指WinAPI,并添加了标签......一个完整的例子(包含)会有澄清了这一点。 -
@TanveerBadar:好的...我来自 Amiga,然后从那里直接进入 Linux,所以微软的一切对我来说都是“WinAPI”。 :-D 随意重新标记。
-
是的@DevSolar 这是您提供的链接。
标签: c++ winapi c-strings strcat