0
Got error:(no suitable conversion function in c++)
I got this error on line 45: no suitable conversion function from "std::string" to "const char *" exists This is my code: https://code.sololearn.com/cbf81a6C691e
5 Réponses
+ 4
Compare by using overloaded comparison operator instead.
if(ap == "AM")
+ 2
I am not 100% sure but I think we cannot compare string variable with strcmp. Strcmp is for comapring const char* variable not string variable.
This might be useful:
http://www.cplusplus.com/reference/string/string/compare/
+ 1
Ipang thank you it worked
+ 1
No problem Janak Sharma 👌
0
Adnan Chowdhury thank you