What is a const pointer?
The access modifier keyword const is a promise the programmer makes to the compiler that the value of a variable will not be changed after it is initialized. The compiler will enforce that promise as best it can by not enabling the programmer to write code which modifies a variable that has been declared const. A “const pointer,” or more correctly, a “pointer to const,” is a pointer which points to data that is const (constant, or unchanging). A pointer to const is declared by putting the word const at the beginning of the pointer declaration. This declares a pointer which points to data that can’t be modified. The pointer itself can be modified.
Related Questions
- I must have a corrupt recipe in my cookbook, because I get "bad record number" and "pointer" errors. What is the best procedure to fix this?
- I must have a corrupt recipe in my cookbook, because I get "bad record number" and "pointer" errors. What is the best procedure to fix this?
- What is the difference between const and readonly in C#?
- What is the difference between const and readonly in C#?
- is there a body injury known as a hip pointer?
- What is a const pointer?