Thread: How to convert a System::String^ to a char*

  1. #1
    Registered User
    Join Date
    Feb 2014

    How to convert a System::String^ to a char*

    I have an existing program written in 'C' that I would like to add a UI to. I'm currently using C++ in Visual Studio to do it, with an
    extern "C" {make things go}
    to hold the original 'C' code.

    The problem is that the 'C' code requires a char * and the value from the UI textbox outputs a System::String type.

    How can I convert the value from 'C++' 'textBox1->Text' (System::String) to a 'C' 'char * user_input'?

  2. #2
    Registered User
    Join Date
    Oct 2006
    I found this great link that explains exactly how to do that.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Convert string to char or use 2d array of char?
    By simpleblue in forum C++ Programming
    Replies: 6
    Last Post: 09-25-2011, 05:00 PM
  2. Replies: 11
    Last Post: 06-16-2011, 11:59 AM
  3. Replies: 2
    Last Post: 09-12-2010, 09:15 AM
  4. convert char** (c string array) to std::string[]
    By umen242 in forum C++ Programming
    Replies: 2
    Last Post: 11-11-2008, 05:52 AM
  5. Cannot convert system object to system string?
    By Robert_Sitter in forum Windows Programming
    Replies: 0
    Last Post: 11-18-2005, 02:44 PM