Possible Duplicate:
C++ Why put void in params?
What’s the difference between these two declarations and which is used more commonly?
void function1();
and
void function2( void );
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no difference in C++, where it is well defined that it represents 0 parameters.
However it does make one in C. A function with
(void)means with no parameter, whereas()means with any number of parameters.From http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fparam_decl.htm