我正在开发 Visual Studio C++。
我有这些代码:
CString str;
BYTE byBuffer[10000] = { 0 };
str ="Invalid Command. Spaces are not allowed too!!";
strcpy_s(reinterpret_cast<LPSTR>(byBuffer), 10000, T2CA(str ));
问题是 byBuffer = "Invalid Command. Spaces are not allowed too!!"; 但在下一行之后,字符串发生了变化。LPBYTE lp=byBuffer ; 虽然它适用于像 OK, GOOD JOB 这样的小字符串。ETC..
我通过设置断点来调试整个代码。此外,该函数已被调用到另一个函数,其中 (LPBYTE lpBuffer) 收到了该值。
请帮忙