The built-in library function strcmp() is listed in the header file "string.h".The two strings are compared via strcmp(). Lexicographically speaking, this refers to comparing characters one at a time beginning with the first character until both strings of characters have the same length or a NULL character is met.
The following is the syntax of strcmp() function:-
int strcmp(string leftStr, string rightStr );
It takes two string as arguments and compares the string according to lexicographical order.
It returns a positive value if first string is higher the lexicographical order, return zero if they are same and negative value if the first string is lower in the lexicographical order
// Use of strcmp() in C++
using namespace std;
char s1 = "string1";
char s2 = "string2";
cout<<" \n Difference between strings are = "<<c<<endl;