home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19047 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!munnari.oz.au!spool.mu.edu!umn.edu!staff.tc.umn.edu!wright
  3. From: wright@staff.tc.umn.edu (Mark Wright)
  4. Subject: Function definition style
  5. Message-ID: <1992Dec30.223045.29467@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: staff.tc.umn.edu
  8. Organization: University of Minnesota
  9. Date: Wed, 30 Dec 1992 22:30:45 GMT
  10. Lines: 21
  11.  
  12. Is there any good reason not to use the following style for defining
  13. functions:
  14.  
  15. type function_name( varname1, varname2, varname3 )
  16.  
  17. type varname1;
  18. type varname2;
  19. type varname3;
  20.  
  21. I try to use the style in ansi k&r, but I notice that others are using this
  22. style and I assume they aren't all using pre-ansi compilers.  My problem is
  23. that to use Brief's function listing command the end paren must be on the same
  24. line as the function name, which is difficult to do using k&r 2 style if the 
  25. function needs several structs as parameters.  Besides, it's easier to
  26. document function parameters with k&r 1 style.  Is there any good reason
  27. for me to continue to use k&r 2 style (other than the fact that it makes 
  28. the function declaration in a .h file a simple cut and paste operation)?
  29.  
  30. -- 
  31. Mark Wright
  32. wright@epx.cis.umn.edu
  33.