Skip to content
Related Articles

Related Articles

C | Functions | Question 10
  • Difficulty Level : Basic
  • Last Updated : 07 Jan, 2014

In C, what is the meaning of following function prototype with empty parameter list




void fun()
{
   /* .... */
}

(A) Function can only be called without any parameter
(B) Function can be called with any number of parameters of any types
(C) Function can be called with any number of integer parameters.
(D) Function can be called with one integer parameter.


Answer: (B)

Explanation: Empty list in C mean that the parameter list is not specified and function can be called with any parameters. In C, to declare a function that can only be called without any parameter, we should use “void fun(void)”

As a side note, in C++, empty list means function can only be called without any parameter. In C++, both void fun() and void fun(void) are same.

Quiz of this Question

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :