Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!xanth!mcnc!duke!helios!apte From: apte@helios.cs.duke.edu (Jitendra Apte) Newsgroups: comp.lang.c Subject: Re: strcpy & declaration of functions Message-ID: <14726@duke.cs.duke.edu> Date: 12 Jun 89 12:06:33 GMT References: <4400001@tdpvax> Sender: news@duke.cs.duke.edu Reply-To: apte@helios.UUCP (Jitendra Apte) Organization: Blue Hell - Home of the Blue Devil Lines: 28 In article <4400001@tdpvax> scott@tdpvax.UUCP writes: > >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. I am not a standards nut, but when baffled by the same question a few months ago, I picked up K&R1 and sure enough, on pp192-193 we find the following about declarations : "At most one sc-specifier may be given in a declaration. If the sc-specifier is missing from a declaration, it is taken to be `auto' inside a function, `extern' outside. Exception : functions are never automatic". PS. `sc-specifiers' are auto, static, extern, register and typedef. From the above, I concluded that the two forms of declaring functions are completely equivalent. Jitendra. (Internet) apte@cs.duke.edu; (UUCP) {decvax|ihnp4|allegra}!duke!apte "Let us save the kid from abortion, so that he can grow up to steal bread, rob banks and murder people. Then we can kill him in the electric chair".