Reputation: 29
In C#, I can easily use @"path" to get path that is acceptable to System.IO functions but in C++.NET I am stuck as my path is like "C:\roam..." so it processes "\r" and removes it. So I am not able to get an acceptable path format. Please help.
Upvotes: 0
Views: 381
Reputation: 180997
You'll need to use \\ to write a backslash in a C++ character constant, that is "C:\\roam".
Upvotes: 1
Reputation: 122001
You need to escape the backslash character:
std::string path("C:\\roam");
Upvotes: 1