I am very new to C (after many years). I am using lcc64 and have the following statement
char *logMessage = strdup(argv[1]);
I have no idea why I get the error
"operands of = have illegal types 'pointer to char' and 'int"
Any suggestions?
I am very new to C (after many years). I am using lcc64 and have the following statement
char *logMessage = strdup(argv[1]);
I have no idea why I get the error
"operands of = have illegal types 'pointer to char' and 'int"
Any suggestions?
you need to include
<string.h>
to declare strdup() as returning char*, else the compiler thinks it returns an int