I am working on a Qt5 project written in C++. Building the project gives an error:
C2440: \'=\': cannot convert from \'const char [9]\' to \'char*\'<
In C++, in contrast to C, string literals are const. So any pointer to such a string literal must be const, too:
const
const char* port_name = "\\\\.\\COM4"; // OK // char* port_name = "\\\\.\\COM4"; // Not OK