A

Admin • 833K Points
Coach

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

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

Explanation by: Admin

The correct way to define a function with a reference parameter is 'void myFunction(int &x) { }'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.