| 1. |
What is the purpose of strcmp function? |
|
Answer» Strcmp function. This function compares two strings to find out whether they are the same or different. The string comparison starts with the first character in each string and continues with subsequent characters until the corresponding characters differ or until the end of the strings is reached. If the two strings are identical, strcmp () returns a value zero. If they are not, it returns the numeric difference between the ASCII values of the non-matching characters. Example: void main () Output: 0 – 1 – 32 |
|