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 / santosh

Pointer to constant: If pointer is pointing to constant
variable is caller pointer to constant. We can not change
the value of that constant.
const int constVariable = 6;
int *ptrConstVar = &constVariable;

Constant Pointer: We declare a pointer as constant. We can
change the content pointed by pointer. But we can not do any
airthmatic operation on the pointer like increment or decrement.
int localVariable =10;
const int *p = &localVariable;

we can not do p++ or p--;

Is This Answer Correct ?    23 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between abs() and fabs() functions?

1058


Explain high-order bytes.

1059


How a string is stored in c?

1013


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2749


Can one function call another?

1046


What are qualifiers in c?

978


Explain how can I pad a string to a known length?

1122


Is it possible to pass an entire structure to functions?

940


What is difference between constant pointer and constant variable?

1198


What do the functions atoi(), itoa() and gcvt() do?

1134


What is spark map function?

1051


simple program of graphics and their output display

1934


Which is the best website to learn c programming?

1026


Can a local variable be volatile in c?

933


What is pointers in c with example?

1018