c++ - Default argument of type const char * is incompatible with . . . The problem you're having is that it's illegal to drop const qualifiers (with the exception of the infamous const_cast or equivalent C-style cast) Since you're only reading from sir, you can fix this by making sir be const char* instead, which doesn't violate const:
Compiler Error C2440 | Microsoft Learn The compiler generates C2440 when it can't convert from one type to another, either implicitly or by using the specified cast or conversion operator There are many ways to generate this error We've listed some common ones in the Examples section
Passing String Pointers to Functions - C++ Forum I chose Desktop Application ( exe) as the application type, selecting Empty project as an additional option Added a new C C++ file and wrote the code I posted above
Compiler Error 167 - Cookbook | Mbed argument of type <type1> is incompatible with parameter of type <type2> This error means that you are calling a routine which takes a parameter of type2 but you are passing in a variable of type1