A

Admin • 37.06K Points
Coach

Q. Which of the following is the correct way to define a function with a default argument in C++?

  • (A) void myFunction(int x = 10) { }
  • (B) void myFunction(int x) { }
  • (C) Both A and B
  • (D) None of the above
  • Correct Answer - Option(A)
  • Views: 51
  • Filed under category C++

Explanation by: Admin
The correct way to define a function with a default argument is 'void myFunction(int x = 10) { }'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics