Prototypes

david nugent david at csource.oz.au
Mon Jul 9 16:19:23 AEST 1990


In <55550 at lanl.gov> rdw2030 at venus.tamu.edu writes:

>With all this talk about prototypes lately, I must admit... though I've been
>programming in C for years, I've never understood why they exist!  Programs
>run without them!

Sure.
     

>My question... why prototypes?  I know they are part of the ANSI standard, but
>what is their purpose!?

Simple - type checking, and the benefit of implied type casting.  The latter
is particularly good in a memory segment (ugh!) environment, and takes care
of near/far pointer conversion.

By using prototypes, you lessen the need to ever need to use LINT; for basic
maintenance, anyway.  They've saved me many hours of frustrating bug-busting
by allowing the compiler to check types passed as parameters.

Converting from a situation where you use none to using prototypes should
a) be annoying as hell, and b) be rewarding in the long run.


david

-- 
_______________________________________________________________________________
 Unique Computing Pty Ltd  Melbourne  Australia  -  Communications Specialists 
        david at csource.oz.au    3:632/348 at fidonet    28:4100/1 at signet           



More information about the Comp.lang.c mailing list