|
-
August 6th, 2009, 06:00 AM
#1
Problem with system paths
Hi!
I'm working with strings containing file paths with the format:
"C:\Folder1\Folder2\fileName.txt"
The problem is that some methods I'm going to use later (mkdir, etc.) don't like this format and they use:
"C:\\Folder1\\Folder2\\fileName.txt"
So the question is, how can I change character '\' for string "\\" in a string?
I have taken a look to string class, also I've tried with:
replace(str_in.begin(), str_in.end(), "\\", "\\\\") from library <algorithm>
with no success, since replace requires a character, not a string.
Thanks in advance!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|