Xref: utzoo comp.lang.c:8423 comp.sys.ibm.pc:13522 Path: utzoo!mnetor!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mdf From: mdf@tut.cis.ohio-state.edu (Mark D. Freeman) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: C declaration styles Message-ID: <8695@tut.cis.ohio-state.edu> Date: 22 Mar 88 17:39:30 GMT References: <5699@watdragon.waterloo.edu> <1065@sask.UUCP> Reply-To: mdf@tut.cis.ohio-state.edu.UUCP (Mark D. Freeman) Organization: StrongPoint Systems, Inc.; Columbus, OH. (guest of Ohio State U.) Lines: 29 In <1065@sask.UUCP> coleman@sask.UUCP (Geoff Coleman @ College of Engineering) writes: >> When I write my C functions on my personal computer, my declarations >> are often like this : >> >> void foo(int x, double y) > > Could you please tell us what kind of PC (if not an MS-DOS) >and what kind of compiler you ate using. The above isn't Lattice >or Microsoft and I would be suprised if it is Turbo. Actually, Microsoft C 5.0 supports this syntax. Soon, most C compilers will, as it is part of the emerging ANSI C standard. It allows the compiler to do argument count and type checking, helping you to avoid silly errors that are easy to miss when checking by hand. Another great idea: make your declarations look like this... void foo(int x, double y) /* DECLARATION */ and you can create quick and dirty documentation for yourself with one grep piped through sort, resulting in an alphabetized list of all your functions showing the number and types of arguments for each! Great for libraries that you are writing. -- Mark D. Freeman (614) 262-1418 mdf@tut.cis.ohio-state.edu 2440 Medary Avenue ...!cbosgd!osu-cis!tut.cis.ohio-state.edu!mdf Columbus, OH 43202-3014 Guest account at The Ohio State University