Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: *\"LDA\" ok? Message-ID: <6332@brl-smoke.ARPA> Date: Mon, 24-Aug-87 14:24:37 EDT Article-I.D.: brl-smok.6332 Posted: Mon Aug 24 14:24:37 1987 Date-Received: Tue, 25-Aug-87 03:58:15 EDT References: <8877@brl-adm.ARPA> <8088@mimsy.UUCP> <1623@tekchips.TEK.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <1623@tekchips.TEK.COM> barts@tekchips.UUCP (Bart Schaefer) writes: >I suppose, however, that it could be argued that this will only delay >understanding strcmp(), but at least the novice will have a "function" >that does what built-in equivalency tests in other languages already do. Perhaps it would help if they were told that strcmp() does NOT test for string equality; rather, it compare the lexical ordering of two strings. This makes it useful sometimes for the function used with qsort(). The test for exact match is simply a common special case. People often have the same problem understanding the function of the UNIX "cat" utility; they think of it as "printing a file", but that is just a special case of its general use as a file concatenator. This attempt to achive maximal generality is characteristic of UNIX, at least as it was originally developed, and is one of the first things that a person learning to program in C or on UNIX should learn. Kernighan & Plauger's "Software Tools" is a good introduction; Kernighan & Pike's "The UNIX Programming Environment" also teaches this point.