Xref: utzoo alt.sources.wanted:1053 comp.sources.wanted:15699 comp.software-eng:5030 comp.lang.c:36986 Path: utzoo!utgpu!cs.utexas.edu!samsung!olivea!oliveb!amdahl!JUTS!duts!cpm00 From: cpm00@duts.ccc.amdahl.com (Craig P McLaughlin) Newsgroups: alt.sources.wanted,comp.sources.wanted,comp.software-eng,comp.lang.c Subject: Re: WANTED: "C" code line counter program Message-ID: Date: 12 Mar 91 16:36:41 GMT References: <1991Mar6.214157.18633@ntpal.uucp> <1991Mar11.182848.26693@comm.wang.com> Sender: netnews@ccc.amdahl.com Reply-To: cpm00@DUTS.ccc.amdahl.com (PUT YOUR NAME HERE) Organization: Amdahl Corporation, Sunnyvale CA Lines: 20 In article <1991Mar11.182848.26693@comm.wang.com> lws@comm.wang.com (Lyle Seaman) writes: >dcavasso@ntpal.uucp (Dana Cavasso) writes: >> I need a "C" code line counter program, preferably written in >>"C". It will be used on several platforms, so solutions involving > >Counting semi-colons is a pretty good approach, as that counts C >statements. Lines is kind of less meaningful. Counting '{' is >an interesting one, too. > Counting semi-colons may miscount setups like the one below: while(condition) do_this; That's two, I think. :) What about counting newlines, but ignoring those that immediately follow another newline (ie, skip blank lines)? Craig McLaughlin cpm00@duts.ccc.amdahl.com V:(408)737-5502 I think it's time to come up with a witty signature and disclaimer...