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 a struct c#?
What is sizeof return in c?
Why cant I open a file by its explicit path?
What's a good way to check for "close enough" floating-point equality?
What are Macros? What are its advantages and disadvantages?
Explain the difference between structs and unions in c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
Why flag is used in c?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Explain what are the advantages and disadvantages of a heap?
How to delete a node from linked list w/o using collectons?
Can we use visual studio for c?
Explain a pre-processor and its advantages.
Explain what standard functions are available to manipulate strings?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above