Search code examples
visual-c++-2010

How Do I Create Raw String in Visual C++?


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.


Solution

  • You'll need to use \\ to write a backslash in a C++ character constant, that is "C:\\roam".