C++ FAQ Celebrating Twenty-One Years of the C++ FAQ!!!
(Click here for a personal note from Marshall Cline.)
Section 29:
[29.4] Should I use f(void) or f()?

f() C programmers often use f(void) when declaring a function that takes no parameters, however in C++ that is considered bad style. In fact, the f(void) style has been called an "abomination" by Bjarne Stroustrup, the creator of C++, Dennis Ritchie, the co-creator of C, and Doug McIlroy, head of the research department where Unix was born.

If you're writing C++ code, you should use f(). The f(void) style is legal in C++, but only to make it easier to compile C code.

This C++ code shows the best way to declare a function that takes no parameters:

void f();      // declares (not defines) a function that takes no parameters
This C++ code both declares and defines a function that takes no parameters:
void f()       // declares and defines a function that takes no parameters
{
  ...
}
The following C++ code also declares a function that takes no parameters, but it uses the less desirable (some would say "abomination") style, f(void):
void f(void);  // undesirable style for C++; use void f() instead
Actually this f() thing is all you need to know about C++. That and using those new fangled // comments. Once you know those two things, you can claim to be a C++ expert. Go for it: type those magical "++" marks on your resumé. Who cares about all that OO stuff — why should you bother changing the way you think? After all, the really important thing isn't thinking; it's typing in function declarations and comments. (Sigh; I wish nobody actually thought that way.)