Skip to main content
gamedev.net
🔒 Locked

[.net] .net managed C++ using pointers/references

Started by Leadorn Jan 16, 2007 at 8:40 AM 1 replies 1.2k views
Original Post
Leadorn
Leadorn
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"; }
vermilion_wizard
vermilion_wizard
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.)
Leadorn
Leadorn
Thank u so much! I give u a gold star :D

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.