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

Does c have function or method?

1058


What is ## preprocessor operator in c?

1129


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2530


Can include files be nested? How many levels deep can include files be nested?

1199


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2495


What is string in c language?

1245


Which of these functions is safer to use : fgets(), gets()? Why?

1161


What are c identifiers?

1149


What is cohesion and coupling in c?

1095


How can I dynamically allocate arrays?

1159


In C language, a variable name cannot contain?

1324


What is the meaning of 2d in c?

1166


What is the difference between typedef struct and struct?

1163


What is a far pointer in c?

1098


Differentiate call by value and call by reference?

1024