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);