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 the parts of c program?
What is getch?
find out largest elemant of diagonalmatrix
Why is c called a mid-level programming language?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
Can you tell me how to check whether a linked list is circular?
hi send me sample aptitude papers of cts?
What will be your course of action for a push operation?
What is void main () in c?
How do I create a directory? How do I remove a directory (and its contents)?
What is difference between structure and union?
What are the three constants used in c?
What is spaghetti programming?
What are dangling pointers? How are dangling pointers different from memory leaks?
How can you return multiple values from a function?