What is a const pointer, and how does it differ from a pointer to a const?
Answer Posted / glibwaresoftsolutions
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
What is the use of c language in real life?
Does c have circular shift operators?
Write a program to swap two numbers without using third variable in c?
Write a code to generate divisors of an integer?
Explain the process of converting a Tree into a Binary Tree.
List the difference between a "copy constructor" and a "assignment operator"?
Explain function?
What is a void pointer in c?
Is printf a keyword?
What is include directive in c?
What is a shell structure examples?
What is a struct c#?
What is self-referential structure in c programming?
What is the maximum length of an identifier?
What is pragma c?