what is constant pointer?

Answer Posted / srsabariselvan

constant Pointer:
we can't modify the value of pointer.i.e.,value of
pointer is constant.
Declaration:
int i=2,j;
int const *p;
p=&i;
p=&j;
Pointer Constant:
in case of Pointer constant, we can't modify the address of
pointer.i.e,address stored in pointer is constant.
This must be intialized
Declaration:
int i=2;
int *const p=&i;
*p=4;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me with an example the self-referential structure?

762


If errno contains a nonzero number, is there an error?

1054


How to set file pointer to beginning c?

914


Differentiate between declaring a variable and defining a variable?

829


What is a const pointer?

808


What is action and transformation in spark?

838


Which programming language is best for getting job 2020?

793


Is sizeof a keyword in c?

769


List some of the dynamic data structures in C?

1009


What are pointers? What are stacks and queues?

786


Why void is used in c?

776


What is the purpose of void pointer?

795


This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory

1001


What is the use of #define preprocessor in c?

827


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

875