0

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.

1
  • Not quite C++0x has support for raw strings. But you probably need VS 2012. Look here for raw string: en.wikipedia.org/wiki/C%2B%2B11 Commented Mar 6, 2012 at 15:03

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

You need to escape the backslash character:

std::string path("C:\\roam");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.