[Solved] Error in strcmp C++?


Template: int strcmp ( const char * str1, const char * str2 );

strcmp() compares the C string str1 to the C string str2.

1. return value<0 :

the first character that does not match has a lower value in ptr1 than in ptr2.

2. return value=0

the contents of both strings are equal.

3. return value>0

the first character that does not match has a greater value in ptr1 than in ptr2.

The line if(result > 1) should be if(result>0) .

solved Error in strcmp C++?