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...

const char *

char * const

What is the differnce between the above two?

Answer Posted / p s

const char *s; is a non-const pointer to const char
char * const s; is a const pointer to non-const char

Once u assign a value to the const poinet it cannot be
reassigned another value till u use casting techniques..

char a = 'A';
char b = 'B';
char *const c = &a;
c = &b; //flags an errror

const char *s = &a;
s = &b //works

Is This Answer Correct ?    19 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the latest version on c++?

1130


What is different in C++, compare with unix?

1074


How delete [] is different from delete?

1002


What is c++ virtual inheritance?

1119


How can you specify a class in C++?

1268


What's the "software peter principleā€?

1138


What is struct c++?

989


Why do we use classes in c++?

1045


Implement stack operations with pointers with appropriate exception checks.

965


Can manipulators fall in love?

998


What do you mean by translation unit?

1087


How const int *ourpointer differs from int const *ourpointer?

1116


What is meant by iomanip in c++?

1198


what is the use of void main() in C++ language?

1110


What is lazy initialization in c++?

1096