Mail Archives: djgpp/1998/08/14/00:31:17
Gerhard Gruber wrote:
> Destination: Merlin <merlin__ AT geocities DOT com>
> From: Gruber Gerhard
> Group: comp.os.msdos.djgpp
> Date: Thu, 13 Aug 1998 08:16:15 GMT:
>
> >> No, this isn't a prototype. This is:
> >>
> >> void do_nothing(void);
> >
> > if you leave the void in brackets out it will be assumed..
>
> That's wrong.
>
> The function(void) means that you specifically say that these function takes
> no arguments. a call like this function(i) yields an error. If you leave the
> void out then this means you don't give the compiler a hint what this function
> takes. writing function() or function(i) or function(a, b, c, d, e) is
> considered valid in this case, so leaving the void out is not the default vor
> void. It is totaly different.
wow...i didn't know this...i was told it was assumed...
but i still suppose that leaving void out would be ok... I mean it would be silly
to pass parameters to a function that didn't require any. So in effect it would
turn out pretty much the same whether or not you specify void in the brackets or
not...
l8r,
Merlin.
- Raw text -