When running a C ++ code these two problems occur:
- [BCC32 Error] USerialCommunication.cpp(96): E2034 Cannot convert 'wchar_t *' to 'const char *'
- [BCC32 Error] USerialCommunication.cpp(96): E2342 Type mismatch in parameter '__src' (wanted 'const char *', got 'wchar_t *')
Source Code:
void __fastcall TFSerialPort::EnviarClick(TObject *Sender)
{
char buff[100];
//Converte uma string em array.
strcpy(buffer, EdCommand->Text.c_str());
}
EdCommand statement: TEdit *EdCommand;
Buffer declaration: char buffer[100];
Error occurs on line of strcpy
.
Note: The source code was made in C ++ Builder 6 and I'm trying to run it on Embarcadero XE2