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
How can you pass an array to a function by value?
What is the size of enum in bytes?
Do variables need to be initialized?
What is the c language function prototype?
What is define c?
Is a pointer a kind of array?
What are the advantages and disadvantages of pointers?
Explain what is dynamic data structure?
How to declare a variable?
Explain setjmp()?
What is function prototype in c language?
How can I pad a string to a known length?
Explain what is the difference between a string and an array?
What are the types of pointers in c?
Explain why C language is procedural?