Saved Bookmarks
| 1. |
Write a short note on const keyword with example |
|
Answer» 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. |
|