write a short note on const keyword with example
Answers
Answered by
4
A function becomes const when the const keyword is used in the function's declaration. The idea of const functions is not to allow them to modify the object on which they are called. It is recommended the practice to make as many functions const as possible so that accidental changes to objects are avoided.
Answered by
4
- ☛A function becomes const when the const keyword is used in the function's declaration. The idea of const functions is not to allow them to modify the object on which they are called. It is recommended the practice to make as many functions const as possible so that accidental changes to objects are avoided.
Similar questions
English,
2 months ago
History,
2 months ago
Math,
4 months ago
CBSE BOARD X,
4 months ago
Science,
10 months ago