C function with no parameters behavior

In C++, void no_args() declares a function that takes no parameters (and returns nothing).

In C, void no_args() declares a function that takes an unspecified (but not variable) number of parameters (and returns nothing). So all your calls are valid (according to the prototype) in C.

In C, use void no_args(void) to declare a function that truly takes no parameters (and returns nothing).

Leave a Comment