Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!oberon!sdcrdcf!trwrb!aero!venera.isi.edu!lmiller From: lmiller@venera.isi.edu (Larry Miller) Newsgroups: comp.lang.c Subject: Re: Weird C code as test for employment Message-ID: <3363@venera.isi.edu> Date: Fri, 7-Aug-87 12:37:17 EDT Article-I.D.: venera.3363 Posted: Fri Aug 7 12:37:17 1987 Date-Received: Tue, 11-Aug-87 00:48:48 EDT References: <8644@brl-adm.ARPA> Reply-To: lmiller@venera.isi.edu.UUCP (Larry Miller) Organization: Information Sciences Institute, Univ. of So. California Lines: 17 In article <8644@brl-adm.ARPA> Leisner.Henr@Xerox.COM (marty) writes: >Thinking about it, I think the test may have value. > >Not so much for coming up with the correct answer, but being able to >demonstrate an approach to attack the problem. > Here's how I "solved" the test-- 1) Run through lint. That immediately found the ****cp vs ***cp problem. 2) Compiled the first version and looked at the output on running it. Weird. 3) Fixed the code based on the lint output, recompiled and ran. Output looked reasonable. Lesson--Run all code through lint.