11.1 C++ String Literals
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

11.1 C++ String Literals

Visual Studio .NET 2003

An implicit conversion exists between an ordinary C++ string literal (with or without the L prefix) and a variable of type System::String.

Example

// mcpp_string.cpp
// compile with: /clr
#using <mscorlib.dll>
using System::String;
int main() {
   String *s1 = "a string literal";
   String *s2 = L"a wide string literal";
};
Show:
© 2016 Microsoft