Click here to Skip to main content
14,826,846 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to take the textbox value into char array so please help me out actually textbox->text will return string^ so how to convert it into char array

Thanks in advance

You can make such a conversion using StringToHGlobalAnsi()[^] method of the Marshal class. See the example from the documentation of this method, it does exactly such conversion.

Alternatively CString class provides a constructor which takes argument of type System::String^. :)

PtrToStringChars will do that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900