函数连接两个写入缓冲区开头的字符串
Function to concatenate two string who write to the begin of this buffer?
我们在Win32Api、中有StringCchCat函数
将一个字符串连接到另一个字符串。目的地的大小为函数提供缓冲区,以确保StringCchCat不要写超过这个缓冲区的末尾。
好吧。。
StringCchCat(dirWPath, MAX_PATH, TEXT("\*"));
我将得到:dirWPath+"\\*"
我想得到一个:"\\*"+dirWPath
有人有解决方案吗?
std::string first = dirWPath, second = "\*";
std::string result = second + first;
您可以先传递通配符:
char str1[MAX_PATH] = "\*";
StringCchCat(str1, MAX_PATH, dirWPath);
相关文章:
- C++字符*缓冲区的大小
- 为什么msgrcv()将垃圾字符馈送到缓冲区
- 使用动态分配的数组会导致代码分析发出虚假的C6386缓冲区溢出警告
- ostream过载时的缓冲区冲洗
- C++中的高效循环缓冲区,它将被传递给C样式数组函数参数
- Xaudio2在更改缓冲区或循环时弹出声音
- 为什么我在leetcode上收到AddressSanitizer:地址0x602000000058上的堆缓冲区溢出错误
- 如何将图像传输到c++(dll)中的缓冲区,然后在c#的缓冲区中读/写
- 如何在cpp.中使用协议缓冲区存储大缓冲区/数组(char/int)
- 多线程双缓冲区
- Android P-9.0.0_r53 Logcat主缓冲区超出定义大小
- 套接字读取后,我在缓冲区中看到意外输入
- Visual Studio(或任何其他工具)能否将地址解释为调用堆栈(boost上下文)的开头
- std::带有自定义缓冲区的 iostream 不允许我写入
- 从返回的顶点缓冲区查询顶点结构
- Vulkan 中的动态顶点缓冲区格式设置
- OpenGL 16 位模板缓冲区?
- 在 leetcode 上提交解决方案时出现堆栈缓冲区溢出错误
- 函数连接两个写入缓冲区开头的字符串
- Qt - 如何设置音频播放从缓冲区的开头开始