wats the diference btwen constant pointer and pointer to a
constant.pls give examples.

Answer Posted / sanjay

Pointer to a consttant ::: such that the value to which
pointer points can't be changed
const int *ptr1=7
*ptr=8 // invalid
constant pointer :::: pointer direction can't be cheged .
int *const x =6;
x=7 or x=&i // invalid
Location of pointer can't be chenged.

Is This Answer Correct ?    18 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between char array and char pointer?

527


What is a far pointer in c?

599


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

636


How can a process change an environment variable in its caller?

656


Does c have enums?

602






What are enums in c?

663


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1451


in iso what are the common technological language?

1637


write a proram to reverse the string using switch case?

2469


What is %g in c?

620


What is difference between constant pointer and constant variable?

630


Can we increase size of array in c?

542


Linked lists -- can you tell me how to check whether a linked list is circular?

646


Where static variables are stored in memory in c?

523


Why header file is used in c?

577