what does the symbol ^% mean in c++ project [dupli

2019-05-14 21:06发布

问题:

This question already has an answer here:

  • What does the C++/CLI Object^% (caret percent-sign) declaration mean? 5 answers

i have a c# project AAA with the project type “class library", in another c++ project, it add the AAA.DLL in the reference, in the source code

void CTest:OnCallback(OperationCallbackInfo^% oci)

OperationCallbackInfo is class defined in AAA.dll

my question is: what does the symbol ^ and % mean in the parameter?

回答1:

It means what you have isn't really C++ at all, but C++/CLI, Microsoft's proprietary version of the language for .NET.

If memory serves, ^% is the syntax for a "tracking reference". It means (at least pretty much) the same as ref does in C#. From a C++ point of view, it's pretty much the same as defining a parameter as a reference to a pointer.



回答2:

According to this question, it's a "handle", which is a reference (similar to a pointer) in managed C++.



标签: c++-cli