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 are linked lists in c?
Can we declare a function inside a function in c?
How can I handle floating-point exceptions gracefully?
What are Macros? What are its advantages and disadvantages?
how to write optimum code to divide a 50 digit number with a 25 digit number??
Why we use conio h in c?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
Which is an example of a structural homology?
What is the use of c language in real life?
Explain bitwise shift operators?
What is variable declaration and definition in c?
How many bytes is a struct in c?
What is c programming structure?
What does sizeof return c?
What is ambagious result in C? explain with an example.