Can someone please tell me which variables are char and const char* in this message?
In function 'void logger(int, char, float)':
main:1001:21: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
strcpy(tmp, text);
^
This is the code, stripped for testing purposes:
void logger(int level,char text,float val /*=NULL*/) {
char tmp[450];
strcpy(tmp, text);
}
Apparently I will die without understanding how chars work but I am trying. Part of what I don't understand here is where the const designation is coming from. The supposed-to-be-helpful carat is pointing to a close parenthesis. So which variable is magically a const when I've declared neither as such? (At least not on purpose).
10 posts - 3 participants