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

Answer Posted / jamili reddy

int i =12;
int * const ptr = 24; //constant pointer

you can't change the ptr value

const int *ptr = 24;//ptr to a constant

int const * ptr = 24;//ptr to a constant


you can't change the value at ptr

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is that possible to store 32768 in an int data type variable?

687


What is structure padding and packing in c?

614


What are the advantages of the functions?

602


What is the difference between constant pointer and constant variable?

742


How is a pointer variable declared?

588






A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

664


What is the use of parallelize in spark?

570


Can you tell me how to check whether a linked list is circular?

763


What are external variables in c?

543


What are c identifiers?

623


Explain how are portions of a program disabled in demo versions?

649


What is self-referential structure in c programming?

655


Write a program to check armstrong number in c?

633


if p is a string contained in a string?

1404


What does %d do?

712