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
πŸ’¬ Discuss
βœ… Correct Answer: (A) void myFunction(int &x) { }
Explanation: The correct way to define a function with a reference parameter is 'void myFunction(int &x) { }'.
Explanation by: Ram Sharma
The correct way to define a function with a reference parameter is 'void myFunction(int &x) { }'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
150
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
87%
Success Rate