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

Mention the purpose of istream class?

1154


What is istream and ostream in c++?

1203


Explain the uses oof nested class?

1193


What does it mean to declare a destructor as static?

1153


Explain the difference between realloc() and free() in c++?

1072


What do the keywords volatile and mean mutable?

1096


What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

1190


Differentiate between late binding and early binding.

1340


What is the best book for c++ beginners?

1097


What are the advantage of using register variables?

1208


Which one between if-else and switch is more efficient?

1125


Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

1046


How will you call C functions from C ++ and vice-versa?

1192


Do vectors start at 0 c++?

1076


What is function declaration in c++ with example?

1183