OOPs Concepts on C++ related Questions and Answers


Question :   Which of the following is the correct way of declaring a function as constant?
1. const int ShowData(void) { /* statements */ }
2. int const ShowData(void) { /* statements */ }
3. int ShowData(void) const { /* statements */ }
4. Both A and B
Answer :   3 - int ShowData(void) const { /* statements */ }  

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter