In C#, passing by reference is:
void MyFunction(ref Dog dog)
But in C++/CLI code examples I have seen so far, there is no use of ref
but instead ^
symbol is used:
void MyFunction(Dog ^ dog)
Is the use of ^
symbol a direct replacement for ref
when parameter passing? or does it have some other meaning I'm not aware of?
Additional Question: I also see a lot of:
Dog ^ myDog = gcnew Dog();
It looks like it's used like *
(pointer) in C++.. Does it work similarly?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…