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
const char *p, char const *p, const char* const p

Answer Posted / kumar krishna

CONST char *p;
here the const. keyword is coming before the "*p"
So it affects the value pointed by "p" i.e. "*p"
You can't change the character (value pointed by p).
Although you can change the address stored in "p".

char CONST *p;
same explanation as above

char * CONST p;
here the const. keyword is coming before the "p" and
after "*" So it affects the value of "p" (which holds
the address). You can't change the address stored in
"p". Although you can change the value pointed by p
i.e. "*p"

CONST char* CONST p:
here CONST is coming before the "*" as well as after
the "*". Therefore, as expeected neither the address
of nor the value pointed by "p" can be changed.

Is This Answer Correct ?    170 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why are algorithms important in c program?

1174


I heard that you have to include stdio.h before calling printf. Why?

1116


How to Throw some light on the splay trees?

1104


If errno contains a nonzero number, is there an error?

1433


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

2008


the question is that what you have been doing all these periods (one year gap)

2141


What is a lvalue

1149


formula to convert 2500mmh2o into m3/hr

1051


What is a program flowchart and how does it help in writing a program?

1193


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

1247


Why c language?

1125


If I have a char * variable pointing to the name of a function ..

1232


What is a scope resolution operator in c?

1331


Is there a way to switch on strings?

1132


What are the 4 types of unions?

1094