What is a const pointer, and how does it differ from a pointer to a const?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
advantages of pointers?
main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0; } a)0 1 6 2 b)0 1 6 7 c)Compilation error d)None of the above
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
How will you delete a node in DLL?
what is the difference between entry control and exit control statement?
12 Answers Darbari Lal DAV Model School,
whitch value return void main?
What are runtime error?
what is calloc and malloc?
What are the concepts introduced in OOPs?
Predict the output or error(s) for the following: 25. main() { printf("%p",main); }
What is sizeof int?
char ch="{'H','I',0};printf("%s",ch);what is output