I’ve seen methods with the following signature:
void foo (void);
They take no argument, however I’m wondering whether doing this is useful or not. Is there a reason why you would want to do it?
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.
The C++03 standard says (emphasis mine):
This means that if you are talking to the compiler it’s just a matter of taste.
If you are writing code that will be read by others, then the C++ way of doing things is
The other form remains valid only for reasons of compatibility with C, where there was a difference among the two signatures.