what is the difference between char * const and const char
*?
Answer Posted / brindha
Char* const p -> Here pointer P is a const pointer, which
means that this pointer can point to only one memory
location. eg. char* const p = &arr;
p++ ; -> This is invalid
const char* p -> this indicates that the data pointed by
the pointer p is constant & the value in that address
cannot be modified. eg. const char* p = 'a';
*p = 'b'; -> This is invalid
| Is This Answer Correct ? | 30 Yes | 2 No |
Post New Answer View All Answers
What is the heap in c?
What are pointers? What are different types of pointers?
Do you know the use of fflush() function?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
State two uses of pointers in C?
What is the difference between test design and test case design?
What is a constant?
Differentiate abs() function from fabs() function.
Explain void pointer?
What are the disadvantages of external storage class?
What are dangling pointers? How are dangling pointers different from memory leaks?
I heard that you have to include stdio.h before calling printf. Why?
What are register variables in c?
Where is volatile variable stored?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?