strcpy & declaration of functions

scott at tdpvax.UUCP scott at tdpvax.UUCP
Fri Jun 9 08:48:00 AEST 1989


This is for all you standards nuts out there.  When declaring FUNCTIONS which 
is better.   

extern int  atoi();
extern char *foo();

or

int  atoi();
char *foo();


They seem to be equivalent and I have found no mention in K&R.  In fact, in K&R
most often they use the second one.   But on the systems I'm using (UNIX and SCO ZENIX) most often the standard headers use the first but not always.  So which
is best and why and is there any difference.   I myself lean toward the first
so that you know the function is not in the file.  


The second question deals with strcpy().  Is it like memcpy in that if the 
arguments memory overlap the behavior is undefined or is it different.  Is 
pre-ANSI and ANSI different on this.



								 Scott King
								 trsvax!tdpvax!scott at uxc.cso.uiuc.edu

Sorry no disclaimer, my company could care less what my opinions are or what
I do with them.



More information about the Comp.lang.c mailing list