Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / vignesh1988i

Constant pointer :
it is a pointer which points to the same memory location or
to same address and and whatever value the variable which is
pointed by the pointer holds.
for eg :
char a;
char const *p;
p=&a;
here var. a is a memory location having a address and that
variable contains some character data . but this pointer
p points to the same address ( a ) however the value in
var. a changes. finally, THE POINTER POINTED TO AN ADDRESS
IS A CONSTANT ,WHATEVER THE VALUE INSIDE THE VARIABLE MAY BE..

POINTER TO A CONSTANT :
this is a pointer which points to a constant variable
assigned to that pointer. and another pointer can also be
assigned to a same const. variable to point to.

for eg :
char Const a;
char *p,*q;
p=&a;
q=&a;



thank u

Is This Answer Correct ?    32 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to pass an entire structure to functions?

942


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

2108


When should you use a type cast?

1057


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

2155


Why is c so powerful?

1065


What is the difference between #include and #include 'file' ?

1002


write a program to generate address labels using structures?

4520


Explain the difference between call by value and call by reference in c language?

1053


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1936


find the sum of two matrices and WAP for it.

1068


How to create struct variables?

1045


What does c mean in standard form?

1101


Write a program to swap two numbers without using the third variable?

1016


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

1000


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

997