Which of the following statement(s) is/are correct regarding void keyword in C++?
Which of the following statement(s) is/are correct regarding void keyword in C++?
I. To specify the return type of a function when it is not returning any value.
II. To indicate an empty argument list to a function.
Show answerHide answer
Correct answer: (C) Both I and II
Explanation
void is used as the return type of a function that returns nothing, and as in f(void) it shows an empty argument list.