how to check if strings are equal in c++ code example Example: compare string c++ int compare (const string& str) const;