SyntaxFix
Write A Post
Hire A Developer
Questions
In C++ the std::string class implements the comparison operators, so you can perform the comparison using == just as you would expect:
==
if (string == "add") { ... }
When used properly, operator overloading is an excellent C++ feature.