1 Do this,
2
3 wchar_t clone[260];
4
5 wcscpy(clone,szPath);
6
7 Or, if you want to allocate memory yourself,
8
9 wchar_t *clone = new wchar_t[wcslen(szPath)+1];
10
11 wcscpy(clone,szPath);
12
13 //use it
14
15 delete []clone;
16
17 Check out : strcpy, wcscpy, _mbscpy at MSDN
18
19 However, if your implementation doesn't necessarily require raw pointers/array, then you should prefer this,
20
21 #include<string>
22
23
24 //MOST SAFE!
25
26 std:wstring clone(szPath);
分类:
C/C++
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全网最简单!3分钟用满血DeepSeek R1开发一款AI智能客服,零代码轻松接入微信、公众号、小程
· .NET 10 首个预览版发布,跨平台开发与性能全面提升
· 《HelloGitHub》第 107 期
· 全程使用 AI 从 0 到 1 写了个小工具
· 从文本到图像:SSE 如何助力 AI 内容实时呈现?(Typescript篇)
2020-08-17 Qt 自定义QGraphicsItem
2020-08-17 Qt 视图框架QGraphicsItem
2020-08-17 Qt QGraphicsItem要点 积累
2020-08-17 Qt Q_UNUSED() 方法的使用
2020-08-17 Qt 绘图之QGraphicsScene QGraphicsView QGraphicsItem详解
2020-08-17 Qt 使用QGraphicsItem绘制复杂的图形
2020-08-17 Windows安装Python(图解)