visual studio 2010 - Convert System::String to std::string in c++ simply? -


this question has answer here:

i know there lot of google answers out there topic, keep getting error in code.

in gui using visual studio in c++, declared struct in form1.h:

  struct char_build {        string name;    } user;  

but when try retrieve text text box like

 user.name = textbox1->text;  

there's error managed vs. unmanaged strings, , string ^ isn't able go struct.

any ideas of best way retrieve input in text box , use in struct? thanks!

i first converting wstring, string using iterator constructor:

wstring temp(textbox1->text->data()); user.name(temp.begin(), temp.end());  

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -