Line 19:
Cannot convert 'int' into 'const char *'
Type mismatch in parameter '__s1' in call the stricmp( const char *, const char *)
Cannot convert 'int' into 'const char *'
Type mismatch in parameter '__s1' in call the stricmp( const char *, const char *)Cannot convert 'int' into 'const char *'
Type mismatch in parameter '__s1' in call the stricmp( const char *, const char *)Cannot convert 'int' into 'const char *'
Type mismatch in parameter '__s1' in call the stricmp( const char *, const char *)Cannot convert 'int' into 'const char *'
Type mismatch in parameter '__s1' in call the stricmp( const char *, const char *)
I am not able to figure out a way to correct these errors. Please help asap.
Also, why does it say stricmp and not strcmpi? stricmp is no function.
Just another little thing: Try to avoid using <fstream.h> (use its standard equivalent <fstream> instead), and <conio.h> should generally be avoided as well. As well as that, for some reason there is a difference in the error message and the actual function name given (stricmp => strcmpi), though that might be some wierd thing that compiler is doing.
thats not right. i agree he shouldnt use it, but he is in fact calling a string. there is a real difference between "a" and 'a'. "a" is a string literal of one character. 'a' is one character literal and they aren't the same thing. "a" is of type char*, and 'a' is of type char
@modoran is correct... While the "a" (etc.) references are strings, the variable 'ch' is not, it's just a character. Even if he passes &ch, he'll still be in trouble, because 'ch' would not be NULL-terminated. The OP should use character compares, as modoran said.