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

天大地大妈咪最大 提交于 2019-12-07 15:15:50

问题


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++.



来源:https://stackoverflow.com/questions/4999575/what-does-the-symbol-mean-in-c-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!