C++

C++ Program to Compare Two Strings Without Case Sensitive1 min read

You can use this code for to compare strings without case sensitive and not using strcmpi(). I created a “convert” method for convert chars to upper case.

The toupper() function converts ch to its uppercase version if it exists. If the uppercase version of a character does not exist, it remains unmodified. The lowercase letters from a to z is converted to uppercase letters from A to Z respectively.




The behaviour of toupper() is undefined if the value of ch is not representable as unsigned char or is not equal to EOF.

C++ Code:

When you run the program, the output will be:

 

Leave a Comment