Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!lobster!shell!shell!rjohnson From: rjohnson@shell.com (Roy Johnson) Newsgroups: comp.lang.misc Subject: Re: Printing plural forms. Message-ID: Date: 26 Feb 91 16:25:35 GMT References: <1991Feb19.104810.549@ZYX.SE> <3331.27c23984@iccgcc.decnet.ab.com> <3404.27c905aa@iccgcc.decnet.ab.com> Sender: usenet@shell.shell.com (USENET News System) Followup-To: comp.lang.misc Organization: Shell Development Company, Bellaire Research Center, Houston, TX Lines: 26 In-Reply-To: browns@iccgcc.decnet.ab.com's message of 25 Feb 91 17:40:10 GMT In article <3404.27c905aa@iccgcc.decnet.ab.com> browns@iccgcc.decnet.ab.com (Stan Brown) writes: >> In article <1991Feb19.104810.549@ZYX.SE>, arndt@zyx.ZYX.SE (Arndt Jonasson) writes: >>> We all have seen and, in various degrees, been irritated by texts such >>> as: >>> 1 files were copied >>> when it should have been: >>> 1 file was copied >>> >>> I'd like to know: when programming, how do you avoid such errors? >In article <3331.27c23984@iccgcc.decnet.ab.com>, >I stuck my coding pencil in my ear: >> printf("%d error%s copied\n", nfiles, nfiles?"s were":" was"); >> or >> printf("files copied: %d\n", nfiles); >Several persons emailed to point out one or more of the the obvious errors >in the first one. I would correct it to printf("%d file%s copied\n", nfiles, nfiles=1?" was":"s were"); -----------------------------------------------------^ you mean == 8^) -- ======= !{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!rjohnson ======= Feel free to correct me, but don't preface your correction with "BZZT!" Roy Johnson, Shell Development Company