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

differentiate between
const char *a;
char *const a; and
char const *a;

Answer Posted / vignesh1988i

const char *a : means the string is constant and the pointer
is not...

const char *a="HELLO WORLD" , if we take this example for
the whole scope of the program the string is constant and we
can't assign any other string to that pointer 'a'....

char * const a : means the pointer is constant (address) but
string is not......

char * const a="hello world" , if we take this example ,
here the address will be always constant.... string can vary..

char const *a : means string is a constant and pointer is
not..... as we have seen from the first example...


thank u

Is This Answer Correct ?    37 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of pointers in C?

1033


What are pointers in C? Give an example where to illustrate their significance.

1174


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2285


Explain the difference between call by value and call by reference in c language?

1063


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1122


Is there any possibility to create customized header file with c programming language?

1010


What are enums in c?

1133


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16607


How can a number be converted to a string?

1253


Should a function contain a return statement if it does not return a value?

1031


What is array of structure in c programming?

1247


What is the use of typedef in c?

998


Can we add pointers together?

1007


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

2419


Tell me when would you use a pointer to a function?

1020