Jump to content
  • Advertisement
Sign in to follow this  
couetcouet

Unity [.net] Managed, Unmanaged : Use and Convert String [] in char * []

This topic is 3895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am working on a c# application which use managed dll based on unmanaged code. In the c# I have : String[] arraystring In the managed code : ???????????? In the unmanaged c++ function I have char* arraychar [] My problem is I don't know what type I need to use in my Managed c++ function. What is the type of the parameter : System::String^[] (with [] it doesn't works) ? How I convert the parameter in char *[] ? I found this post maybe useful: http://www.gamedev.net/community/forums/topic.asp?topic_id=290530

Share this post


Link to post
Share on other sites
Advertisement
If you are writing a C++/CLI wrapper for your unmanaged function, you can do something like this:


array<String^> ManagedFunction()
{
array<String^>^ results = gcnew array<String^>( count );

for( int i = 0; i < count; i++ )
results = gcnew String( unmanagedStringArray );

return results;
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!