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 structure of c program?

1096


Explain can static variables be declared in a header file?

1115


Which is an example of a structural homology?

1269


write a c program to find the sum of five entered numbers using an array named number

2086


What do you mean by dynamic memory allocation in c?

1057


Explain a pre-processor and its advantages.

1084


What are the advantages of union?

1028


What is register variable in c language?

993


What is the scope of global variable in c?

962


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1542


What is the Purpose of 'extern' keyword in a function declaration?

1040


How can you find out how much memory is available?

1024


Explain the difference between structs and unions in c?

969


What is an endless loop?

1240


Explain what is the difference between the expression '++a' and 'a++'?

1165