I have a TCHAR string which contains a path. I need to replace all occurences, if any, of /
with \
in the path. The variable holding the path is defined as follows:
TCHAR mypath[1024];
If mypath
contains C:/new/newfile/a.txt
, then I would need the /
to be replaced by \
so that the resulting string becomes C:\new\newfile\a.txt
.
Also, the file that I need to adapt already has UNICODE defined as follows:
#ifndef UNICODE
#define UNICODE
#endif
And functions like wcsncmp
have been used for string comparison. How can I achieve character replacement in a TCHAR string?