What is a const pointer, and how does it differ from a pointer to a const?
Answer Posted / nashiinformaticssolutions
1. Pointer to const: The value being pointed to cannot be modified, but the pointer itself can change.
Example:
2. const int a = 10;
3. const int *ptr = &a; // *ptr is read-only
4. const pointer: The pointer cannot change, but the value it points to can.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When should a far pointer be used?
What is the full form of getch?
what is the structure pointer?
write a program for the normal snake games find in most of the mobiles.
Why do we use return in c?
What is the function of volatile in c language?
What is register variable in c language?
What is the difference between void main and main in c?
Can the size of an array be declared at runtime?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
What does node * mean?
What is 'bus error'?
How can I get random integers in a certain range?
How do I determine whether a character is numeric, alphabetic, and so on?
Explain a pre-processor and its advantages.