Is there a way to use verbatim String literals in managed C++? Similar to C#'s
String Docs = @"c:\documents and settings\"
Is there a way to use verbatim String literals in managed C++? Similar to C#'s
String Docs = @"c:\documents and settings\"
This is not currently possible. Managed C++ string literals have almost the exact same rules as normal C++ strings. The managed C++ spec is in fact just an augmentation of the ANSI C++ standard.
Currently there is no support for C# style literal syntax in C++ (managed or not). You must manually escape every character.
See Section 9.1.3.3 in the C++/CLI spec for more details. (Spec Link)