home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / SNIP9404.ZIP / STYLE.C < prev    next >
Text File  |  1994-04-03  |  2KB  |  33 lines

  1. /***************************************************************************/
  2. /*  Global (public) headers look like this                                 */
  3. /*                                                                         */
  4. /*  foo()                                                                  */
  5. /*  Parameters: description of each passed datum                           */
  6. /*  Returns: description of return value & significance                    */
  7. /*  Side effects: complete details                                         */
  8. /*  Notes: extra info                                                      */
  9. /***************************************************************************/
  10.  
  11. /*
  12. ** Static (local) headers look like this
  13. **
  14. ** Brief description
  15. */
  16.  
  17. int foo(void)   /* use ANSI prototypes on every compiler that supports 'em */
  18. {
  19.         int local1, local2;     /* local variable declarations are always
  20.                                    followed by a blank line                */
  21.  
  22.         do_stuff();
  23.         if (bar(local1))
  24.         {       /* long comments here *//* this lines up with -----------+ */
  25.                 char *local3;           /* autos declared close to use   | */
  26.                                         /*                               | */
  27.                 do_more_stuff();        /* (everything else indented)    | */
  28.                 local2 = strlen(local3);/*                               | */
  29.         }                               /* this <------------------------+ */
  30.         else    local2 = fubar();       /* using tab >= 6, else's line up  */
  31.         return local2;
  32. }                               /* no question where functions end!        */ 
  33.