I need to compare two strings in C++. Suppose the first string is sol and the other one incomplete_ans. They both have the same length. I am using the compare function like this:
if ((sol.compare(incomplete_ans)) == 0)
{
cout<<"***W I N N E R***\n";
}
But, the program prints "Winner" even when the strings are not same.I also tried printing the two strings if somehow they are getting equal in the program; but they are completely different.