
II-162 Programming Concepts
17. What is the difference between the functions strcmp() and stricmp()?
Ans: The strcmp() function compares the two strings. It is case sensitive, i.e., if we have given
two strings ‘hello’ and ‘Hello’ as input to strcmp(), return value by strcmp() will not be zero,
instead it will be 32. This is due to difference between the ASCII values of two characters (Lower case
and upper case characters: example: Difference between ASCII values of a and A). Mismatch will be
found between h and H.
On the other hand, stricmp() is also used to compare the two strings, but it is not case sensitive;
therefore, the output given ...