Re: if I define a function with no parameters, should i put void?

From: Andrey Tarasevich (andreytarasevich_at_hotmail.com)
Date: 02/17/05


Date: Thu, 17 Feb 2005 10:33:45 -0800

TTroy wrote:
> For function definitions (not declarations/prototypes), is it necessary
> to put void in the emptry braces if the function is to receive no
> parameters? Does this turn any error checking off or cause any other
> effects?

No. In a function _definition_ empty '()' immediately means "no parameters".

-- 
Best regards,
Andrey Tarasevich


Relevant Pages

  • if I define a function with no parameters, should i put void?
    ... For function definitions (not declarations/prototypes), ... to put void in the emptry braces if the function is to receive no ...
    (comp.lang.c)
  • Re: LNK 2001 error !!!!!!!!
    ... Wrap the function definitions in an extern "C" block... ... void SomeFunction(void); ... > I have a MFC project in which I need to include source file with ".c" ... > error for functions defined in the files with ".c" extension. ...
    (microsoft.public.vc.mfc)
  • Re: GCC problem
    ... function definitions. ... You should buy the second edition before doing that. ...
    (comp.os.linux.development.system)
  • Re: GCC problem
    ... function definitions. ... that's not a terribly sane thing to do. ... really can't imagine why you would want to do so. ... void capture_callback ...
    (comp.os.linux.development.system)