2 strcmp - compare two strings in the customary ordering of strings
11 return integer (1, 0 or -1)
14 Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2).
15 This function compares up to m values of consecutive characters
16 in the strings s1 and s2. If an inequality is encountered, the
17 function returns 1 or -1 according as the greater character is
18 in s1 or s2. If there has been no inequality, the function
19 returns 1, 0, or -1 according as n1 is greater than, equal to,
21 Note that null characters within the strings are included in the
25 strcmp("ab", "abc") == -1
26 strcmp("abc", "abb") == 1
27 strcmp("abc", "abc") == 0
28 strcmp("abc", "abd") == -1
29 strcmp("abc\0", "abc") == 1
30 strcmp("a\0b", "a\0c") == -1
36 FLAG stringrel(STRING *s1, STRING *s2)
39 strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos,
40 strprintf, strscan, strscanf, substr
42 ## Copyright (C) 2006 Ernest Bowen
44 ## Calc is open software; you can redistribute it and/or modify it under
45 ## the terms of the version 2.1 of the GNU Lesser General Public License
46 ## as published by the Free Software Foundation.
48 ## Calc is distributed in the hope that it will be useful, but WITHOUT
49 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
50 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
51 ## Public License for more details.
53 ## A copy of version 2.1 of the GNU Lesser General Public License is
54 ## distributed with calc under the filename COPYING-LGPL. You should have
55 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
56 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
58 ## @(#) $Revision: 30.3 $
59 ## @(#) $Id: strcmp,v 30.3 2013/08/11 01:16:03 chongo Exp $
60 ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strcmp,v $
62 ## Under source code control: 2006/03/03 03:32:44
63 ## File existed as early as: 2006
65 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
66 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/