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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!