Computer Science, asked by mohamedsheikm410, 2 months ago

write a short note on const keyword with example​

Answers

Answered by ItzBeautyBabe
4

{\tt{\red{\underline{\underline{\huge{Answer:}}}}}}

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 VioletMoon
4

{\tt{\red{\underline{\underline{\huge{Answer:}}}}}}

 \\

  • ☛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.

 \\

\sf\purple{@VioletMoon♡}

Similar questions