what is the difference between
const char *p, char const *p, const char* const p
Answer Posted / kumar krishna
CONST char *p;
here the const. keyword is coming before the "*p"
So it affects the value pointed by "p" i.e. "*p"
You can't change the character (value pointed by p).
Although you can change the address stored in "p".
char CONST *p;
same explanation as above
char * CONST p;
here the const. keyword is coming before the "p" and
after "*" So it affects the value of "p" (which holds
the address). You can't change the address stored in
"p". Although you can change the value pointed by p
i.e. "*p"
CONST char* CONST p:
here CONST is coming before the "*" as well as after
the "*". Therefore, as expeected neither the address
of nor the value pointed by "p" can be changed.
| Is This Answer Correct ? | 170 Yes | 11 No |
Post New Answer View All Answers
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
Can we access array using pointer in c language?
Combinations of fibanocci prime series
How can I call fortran?
Explain what is the difference between the expression '++a' and 'a++'?
How can I invoke another program or command and trap its output?
What is int main () in c?
Write a code to generate divisors of an integer?
What is build process in c?
How can I run c program?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
What is void main () in c?
Explain what is wrong with this program statement?
What is c standard library?
What is the most efficient way to store flag values?