what does the symbol ^% mean in c++ project [duplicate]
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?
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.
According to this question, it's a "handle", which is a reference (similar to a pointer) in managed C++.
精彩评论