write a short note on const keyword with example
Answers
Answered by
1
Answer:
Constant is something that doesn't change. In C language and C++ we use the keyword const to make program elements constant. const keyword can be used in many contexts in a C++ program. It can be used with:
Variables
Pointers
Function arguments and return types
Class Data members
Class Member functions
Objects
const is the keyword used to declare a constant, const keyword modifies / restricts the accessibility of a variable. So, it is known as Access modifier.
Similar questions