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:
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:
or basically found the number of char before the end character (
I hope this will help you to find the solution of your exercise.