Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C | Functions | Question 10

  • Difficulty Level : Basic
  • Last Updated : 28 Jun, 2021

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

Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.




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

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!