Dec 192017
 
Counts the number of procedures, and comment lines in C source.
File CCOUNT12.ZIP from The Programmer’s Corner in
Category C Source Code
Counts the number of procedures, and comment lines in C source.
File Name File Size Zip Size Zip Type
CCOUNT.C 17487 4727 deflated
CCOUNT.DOC 1990 996 deflated
CCOUNT.EXE 12332 7243 deflated

Download File CCOUNT12.ZIP Here

Contents of the CCOUNT.DOC file


In measuring software performance it is necessary to keep track
of how much code is developed and how much time it takes.
To do this, a simple utility that scans source code and counts
non-comment source lines is useful. It may also be useful to
know how many comments appear and how many total procedures /
functions are included. This gives an idea of how well the
programmer is commenting his/her code and if the programs are
one big module or broken into smaller modules.

/* CCOUNT - A 'C' program written to gather statistics from 'C'
* source programs. The main number to count is non-comment logical
* statements (NCLS). We also report the number of PROCEDUREs + FUNCTIONs,
* comments, blank lines, and total source lines and lines of code (LOC).
* NCLS is estimated by counting the number of semicolons, not counting
* those in string constants or comments. A line that contains a semicolon
* and a comment will be counted in both categories. Preprocessor
* directives (lines starting with '#') are also included in the NCLS count.
*
* The program was originally compiled in Turbo C. If it is linked with
* "WILDARGS.OBJ", wildcards can be used for the file name. If no input
* parameter is supplied, it reads the standard input stream. Output is
* both to the console and to a file "CCOUNT.LST".
* Usage: ccount file1.c file2.c ...
* (wildcards are allowed also, e.g.
* ccount *.c *.h
*
* Hacked by Ted Shapin, 2/9/89 from the code for
* "bldfuncs" in Dr Dobbs Journal, Aug. 1988 by Marvin Hymowech.
*
* Version 1.1. 3/15/89.
* Removed nested comments and added unexpected EOF error msg.
* Fixed bug in counting comment lines ending in '*'.
* Added LOC count (lines of code except for comment and blank lines).
* Added preprocessor directives to NCLS count.
*
* Version 1.2 4/6/89. Add preprocessor statements to LOC. Improved
* blank line detection.
*/



 December 19, 2017  Add comments

Leave a Reply