Possible Duplicate:
What does the caret mean in C++/CLI?
System::String
is a class. What does the additional caret mean?
System::String^ productString = L"";
Has anyone seen this before? I can't find anything in Stroustrop on this one.
Possible Duplicate:
What does the caret mean in C++/CLI?
System::String
is a class. What does the additional caret mean?
System::String^ productString = L"";
Has anyone seen this before? I can't find anything in Stroustrop on this one.
This is Microsoft's C++/CLI. The ^
operator is used for accessing .NET reference types. It means sort of a "handle", and the syntax is ClassName^
instead of ClassName*
.
It's not really C++ but C++/CLI (a C++ look-alike language targeting the Common Language Interface)
What does
'System::String^'
mean in C++?
Nothing! Because it isn't C++, its C++/CLI. productString
is a handle ^
to ""
This syntax is specific to C++/CLI, Microsoft's managed version of C++.
Avoid this unless you absolutely must have it for interop with native C++ code. If you are writing managed code, use C# - native code, C++.
It is not a standard C++, it's C++/CLI where System::String^
means a handle to System::String
.