How Does The String Function Strcmpi( ) Compare Two Strings?

1

1 Answers

Akshay Kalbag Profile
Akshay Kalbag answered
The string function strcmpi( ) is not case-sensitive. That is, it does not matter whether a string is written in all capitalised letters, all lower-case letters or in a combination of both capitalised and lower-case letters. For does the string function strcmpi( ) to compare two strings, first of all both the strings in question have to converted either into the upper-case or into the lower-case before comparing the two strings.

In other words the string function strcmpi( ) which is used for the purpose of comparing two strings is case-insensitive. It is commonly used for the purpose of comparing two strings in the C programming language.

To compare two strings, the string function strcmpi(char*szOne, char*szTwo) is used. If both the characters, namely character one and character two are equal, the result will be zero. It will obviously be more than zero if either character one is greater than character two or if character two is greater than character one or if character one is less than character two or if character two is less than character one.

Answer Question

Anonymous