You have to compare the length of the strings not the string itself.
if you use std::string to store one of your string, you can use the length method:
std::string mystring;
int mystring_length = mystring.length();
if you use an array of char to store the strings, you can use a function to get the length:
int mystringlength=strlen(mystring);
or basically found the number of char before the end character (
'\0'
)
I hope this will help you to find the solution of your exercise.