http://denniskubes.com/2013/03/22/basics-of-function-pointers-in-c/
If you have a prototype “void something();” (with no ‘void’ in the argument list) then this function takes an undetermined number of arguments. When you define a function body, e.g. “void something(){ return; }”, then the function takes no arguments.
void something(); // prototype of function that takes undetermined number of arguments
void something(void); // prototype of function that takes no arguments
void something() { return; } // function that takes no arguments
The “void” is particularly important for prototypes and function pointer declarations. Take this example which compiles fine (but obviously won’t run):
int main()
{
void (*something)() = 0;
something(1, 2, 3, 4, 5);
}
But, this won’t compile:
int main()
{
void (*something)(void) = 0;
something(1, 2, 3, 4, 5);
}
The two declarations are not the same.