πŸ“Š C++
Q. Which of the following is the correct way to define a function with a const reference parameter in C++?
  • (A) void myFunction(const int &x) { }
  • (B) void myFunction(int &x) { }
  • (C) Both A and B
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) void myFunction(const int &x) { }

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

Explanation by: Rakesh Kumar
The correct way to define a function with a const reference parameter is 'void myFunction(const int &x) { }'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
113
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
85%
Success Rate