wats the diference btwen constant pointer and pointer to a
constant.pls give examples.
Answer Posted / rudra prasad panda
Pointer is a variable containing the addres of another
variable;
Constant pointer is a variable which points to a variable
constantly.it means that , once it is initialised,it cannot
be changed.Till the end of program,it points to that
variable only;
EXAMPLE:
char k,m;
const char *p=&k;
p=&m;//(syntax error)
********
A pointer to a constant is a pointer such that the contents
of the variable(pointed by the pointer)cannot be modified
throuhg the pointer;
EXAMPLE:
char m='l';
char * const p;
p=&m;
*p='u';//syntax error
m='k';//no syntax error
| Is This Answer Correct ? | 8 Yes | 42 No |
Post New Answer View All Answers
What is %d called in c?
What are the functions to open and close the file in c language?
please send me the code for multiplying sparse matrix using c
Do you know what are the properties of union in c?
What is difference between array and pointer in c?
What are pointers in C? Give an example where to illustrate their significance.
How old is c programming language?
What does double pointer mean in c?
What is the difference between the = symbol and == symbol?
What is the maximum no. of arguments that can be given in a command line in C.?
What are the disadvantages of external storage class?
Is void a keyword in c?
What are the two forms of #include directive?
How do you determine a file’s attributes?
Explain what’s a signal? Explain what do I use signals for?