Re: function prototype vs function declaration
- From: santosh <santosh.k83@xxxxxxxxx>
- Date: Tue, 18 Dec 2007 16:34:10 +0530
Ravishankar S wrote:
"Richard Heathfield" <rjh@xxxxxxxxxxxxxxx> wrote in message
news:eNWdnUUdru5UPvranZ2dnUVZ8qXinZ2d@xxxxxxxxx
Ravishankar S said:
<snip>
It turns out that function
declarations and function prototypes are the same thing in standard
C.
No, it doesn't.
It is true that all function prototypes are function declarations,
but it is not true that all function declarations are function
prototypes.
<snip>
an example would help here.
int fx();
This is a function declaration, but not a prototype. In fact, argument
checking is turned of for functions declared like this. This is for
backwards compatibility and not recommended for new code. Use:
int fx(void);
or specify the parameters explicitly, as a prototype.
.
- Follow-Ups:
- Re: function prototype vs function declaration
- From: Ravishankar S
- Re: function prototype vs function declaration
- References:
- function prototype vs function declaration
- From: Ravishankar S
- Re: function prototype vs function declaration
- From: Richard Heathfield
- Re: function prototype vs function declaration
- From: Ravishankar S
- function prototype vs function declaration
- Prev by Date: Re: function prototype vs function declaration
- Next by Date: Re: function prototype vs function declaration
- Previous by thread: Re: function prototype vs function declaration
- Next by thread: Re: function prototype vs function declaration
- Index(es):
Relevant Pages
|