Declaring Functions That Take No Arguments

A function declared with the single keyword void in argument-declaration-list takes no arguments, as long as the keyword void is the first and only member of argument-declaration list. Arguments of type void elsewhere in argument-declaration-list produce errors. For example:

long GetTickCount( void );            // OK
long GetTickCount( int Reset, void ); // Error
long GetTickCount( void, int Reset ); // Error

In C++, explicitly specifying that a function requires no arguments is the same as declaring a function with no argument-declaration-list. Therefore, the following two statements are identical:

long GetTickCount();
long GetTickCount( void );

Note that, while it is illegal to specify a void argument except as outlined here, types derived from type void (such as pointers to void and arrays of void) can appear anywhere in argument-declaration-list.