I wrote following code. It's compile properly. when i enter 2 characters in to textbox at run time, it gives an error. Error is :
"String must be exactly one character long."
this is the program, I wote:
#pragma endregion
private: System::Void btnSend_Click(System::Object^ sender, System::EventArgs^ e) {
char caEntry[10];
String ^ strTextBoxContent;
strTextBoxContent = txtEntry->Text;
caEntry[0] = strTextBoxContent[0];
//caEntry[1] = strTextBoxContent[1];
serialPort1->Open();
serialPort1->Write(Convert::ToString(caEntry[0]));
// serialPort1->Write(Convert::ToString(caEntry[1]));
serialPort1->Close();
}
I want to know how to separate the textbox content and it assign to the char array...
thank u...