Final answer:
The strcmp() function compares two strings and returns a negative integer if string1 is less than string2, 0 if both strings are equal, and a positive integer if string1 is greater than string2.
Step-by-step explanation:
The strcmp(string1, string2) function in programming is used to compare two strings lexicographically. If string1 is less than string2, the function will return a negative integer. If string1 is equal to string2, it will return 0. If string1 is greater than string2, then the function will return a positive integer.
These integer values are often used to determine the sort order of strings in a program. No error code is returned by strcmp(); it strictly returns an integer based on the comparison.