[.net] .net managed C++ using pointers/references
Hej
How do i make a reference to another object. For example i want a function that take a string as input and adds texts to the string, which then can be used outside the function. (I want pointers or regerence)
String ^text = gcnew String("asd");
//"asd"
f00(text);
//"asdsnake"
void f00(String ^str)
{
str+= "snake";
}
I think you want:
void f00(String^% str)
void f00([Out] String^% str)
The first is like using ref in C#, the second is like using out in C#. (The distinction between these I think only matters if you assembly will be consumed by a C# application.. but I'm not totally sure on that.)
void f00(String^% str)
void f00([Out] String^% str)
The first is like using ref in C#, the second is like using out in C#. (The distinction between these I think only matters if you assembly will be consumed by a C# application.. but I'm not totally sure on that.)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement