This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Function declaration issues


On Thu, 4 Sep 2003, Nikita Shulga wrote:

This is a C programming question not specific to GCC.

Please ask this on the comp.lang.c Usenet newsgroup
or in some other appropriate forum.

Toshi

> Hi all!
> 
> I was trying to understand, what's the difference between function declaration and prototype. I write the following very simple program, and I wander, if it is all right, to compile without any warnings(of course, with -Wall option)
> gcc version is 3.2.1.
> Here goes the code:
> /*-----------------------------------------------------------*/
> #include <stdio.h>
> int a();
> int main(void) {
>         a("String", 3.1417);
>         a(1, NULL);
>         return a();
> }
> int a(int c, int d) {
>         printf ("c=%d, d=%d\n", c, d);
>         return c+d;
> }
> /*----------------------------------------------------------*/
> And why I can call to a() with any agrument's I like?
> Thanks in advance,
> 	Nikita
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]