I need help getting label1 to display the string that the user inputs.
I know that std::string and System::string are two different types, so I casted the inputted string to String^.
The textbox:
private: System::Void text_box_1(System::Object^ sender, System::EventArgs^ e) { cin >> name; String^ something = gcnew String(name.c_str()); label1->Text = "Name->" + something;Function that returns string:
string getName() { return name; }The problem is, label1 always outputs "Name-> blank". What am I doing wrong?
ليست هناك تعليقات:
إرسال تعليق