问题
Possible Duplicate:
What does the caret (‘^’) mean in C++/CLI?
In C++/CLR, what does a hat character ^ do?
What does the ^ character mean in C++ when applied to the data type in a variable declaration, as in:
String^ input;
or
List<String^>^ phoneNumbers;
回答1:
Assuming a Microsoft-compiler, this is not from C++ but from Microsoft own C++ dialects called C++/CLI. It denotes a .NET-garbage collected object.
回答2:
It's a managed pointer. Similar to *, but collected by the GC.
Oh yeah, and it only works in C++/CLI, obviously (your post was already tagged cli, but I feel the need to explicitly state this).
来源:https://stackoverflow.com/questions/13953002/what-does-the-character-mean-when-used-in-c-declarations