Question: In C++, Write a function int icompare (std::string first, std::string second) which returns a negative number if the first string comes before the second alphabetically,
In C++, Write a function int icompare (std::string first, std::string second) which returns a negative number if the first string comes before the second alphabetically, returns 0 if both strings are equal, and a positive number if the second string comes after the second alphabetically. This function should compare strings ignoring case differences, i.e. "Hello" == "hello" or in other words icompare("Hello", "hello") == 0.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
