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

Where do I find the current c or c++ standard documents?

1027


Write about an iterator class?

1028


What is data types c++?

956


Name the implicit member functions of a class.

1032


Explain object slicing in c++?

1011


Is c++ the best programming language?

961


Why is polymorphism useful?

1018


What is using namespace std in c++?

1087


What is == in programming?

973


What is difference between c++ and c ++ 14?

985


Explain the register storage classes in c++.

1145


What programming language should I learn first?

1036


What is the difference between delegation and implemented-in-terms-of?

958


I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.

2736


What are the various operations performed on stack?

1035