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 |
Why we use break in c?
Taking an example,differentiate b/w loader and linker ?
Why should I prototype a function?
Why structure is used in c?
Is c procedural or object oriented?
Which is better between malloc and calloc?
what is the difference between declaration and definition of a variable or function ?
How to add two numbers without using semicolon n c????
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
errors in computer programmes are called
what are two kinds of java
What is the use of c language in real life?