mardi 18 août 2020

Why does the My String code in if() Not Work? [closed]

I'm Making a chat bot With C++. But i'm trying to find a way to make a condition for the string i made. Like the following:

if(MainChatText = "Hello")
/*main.cpp:20:25: error: could not convert ‘MainChatText.std::basic_string<_CharT, _Traits, _Alloc>::operator=, std::allocator >(((const char*)"Hello"))’ from ‘std::basic_string’ to ‘bool’

*/ I'm Hoping someone could help me with this issue. Thank you.

Aucun commentaire:

Enregistrer un commentaire