home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.software-eng
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!uvaarpa!concert!seq!herbst
- From: herbst@seq.uncwil.edu (R.T. Herbst)
- Subject: C Code Layout
- Message-ID: <1992Dec15.023235.17090@seq.uncwil.edu>
- Keywords: c Code
- Organization: Univ. of North Carolina @ Wilmington
- Date: Tue, 15 Dec 1992 02:32:35 GMT
- Lines: 33
-
-
- Here is a way to have your code and eat it too.
- Each comment suggesct that you escape the editor and look
- at a file the can be as large as you please. The files
- should be in the same directory as the code that is being
- tested or written. The code is not cluttered with long comments.
- Imagine a screen of comments followed by a single instruction that is
- followed by 20 lines of comments.
-
- /* Document
- * :! vi doc.file
- */
- #include <stdio.h>
- main()
- {
- /* Declare internal variables.*/
- int c;
- while(( c = getchar()) != '\n') /* :! vi comment1*/
- ;
- }
-
- cat doc.file
- This program is intended to read characters into the integer c
- until a newline is encountered.
-
- cat comment1
-
- This often used construct will read characters from the standard
- input file until a nelwline is encountered. It is also very
- useful in removing newlines left in the standard input file as a result
- of executing scanf.
- herbst@seq.uncwil.edu
-
-