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

πŸ‘οΈ
155
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
90%
Success Rate