int cmpstr(a, b)
struct string *a, *b;
One by one, the characters of each string are compared until a pair differs. The comparison of the two strings is then equivalent to the comparison of the pair of differing characters. If all the pairs are equal, but one string is shorter than the other, the comparison of the two strings is then equivalent to the comparison of the lengths of the strings. Otherwise, the strings are equal because all pairs are equal and the strings have the same length. When characters are compared no interpretation takes place, i.e., the characters are regarded as one byte (unsigned) numeric values and are compared as such. If one regards the characters as ASCII symbols the ordering is that of the ASCII character set and is similar to that which one intuitively expects. The method is equivalent to that used by sort(1) and strcmp (see string(3)).
This function implements string comparison.
from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber