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 functions are in conio h?

1184


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1275


What are dangling pointers? How are dangling pointers different from memory leaks?

1298


write a c program for swapping two strings using pointer

2624


Is c procedural or object oriented?

1000


What is ponter?

1265


What do you understand by normalization of pointers?

1058


How can I sort more data than will fit in memory?

1098


Can you please explain the difference between syntax vs logical error?

1181


Is c++ based on c?

1070


what do you mean by enumeration constant?

1011


What does the function toupper() do?

1119


What is call by value in c?

1003


What is the difference between array and linked list in c?

1145


What is include directive in c?

1152