What is the difference between constant pointer and pointer
to a constant. Give examples.

Answer Posted / prashant

the example given by Santosh for "Constant Pointer" is wrong .
Use
int * const p = &localVariable;
instead of const int *p = &localVariable;.

then we cant do p++ or p--;

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who developed c language?

635


What will be the outcome of the following conditional statement if the value of variable s is 10?

755


What is integer constants?

611


What is the use of sizeof?

549


What is the difference between a free-standing and a hosted environment?

636






How to implement a packet in C

2389


What is scope and lifetime of a variable in c?

570


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1196


What is the explanation for modular programming?

681


Explain what is the heap?

618


What is #pragma statements?

583


Do you know what are the properties of union in c?

577


Why flag is used in c?

651


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1836


Can one function call another?

622