Q. Which of the following is the correct way to define a function with a variable number of arguments using initializer_list in C++?
β
Correct Answer: (A)
void myFunction(std::initializer_list<int> args) { }
Explanation: The correct way to define a function with a variable number of arguments using initializer_list is 'void myFunction(std::initializer_list<int> args) { }'.