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 difference between struct and typedef struct in c?

1171


How can a program be made to print the line number where an error occurs?

1134


What are enums in c?

1289


Can stdout be forced to print somewhere other than the screen?

1091


What is the difference between text and binary modes?

1243


What are the types of arrays in c?

1239


How many loops are there in c?

1165


Place the #include statement must be written in the program?

1089


Why main function is special give two reasons?

1605


What are local static variables? How can you use them?

1206


difference between native and cross compilers

2173


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1757


What are the two types of structure?

1146


What is anagram in c?

984


What is indirection? How many levels of pointers can you have?

1206