Q. Which of the following is the correct way to define a const member function in C++?

  • (A) void myFunction() const;
  • (B) const void myFunction();
  • (C) Both A and B
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) void myFunction() const;
Explanation: The correct way to define a const member function is 'void myFunction() const;'.
Explanation by: Admin
The correct way to define a const member function is 'void myFunction() const;'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
139
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
93%
Success Rate