C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 31)
31.
Which of the following is the correct way of declaring a function as constant?
Discussion:
13 comments Page 2 of 2.
Vls said:
2 years ago
Here, It asks about a function, not a member function or method. Constness of a standalone function doesn't make sense.
Amit Shahi said:
8 months ago
Here the question is how to declare the function as a constant that's why the C option is the right answer.
If the question is asking how to declare a function return as a constant then the D option is the right answer.
If the question is asking how to declare a function return as a constant then the D option is the right answer.
Dimpi said:
6 months ago
D option is the right one.
Because both A and B options correctly define the function, it returns a const int.
Because both A and B options correctly define the function, it returns a const int.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers