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 char a[] = "string"; and
char *p = "string"; ?

Answer Posted / ashish

here a is an array and is a char const * data type.
hence u cannot change value of a but u can change the value
which a points to.
p on the other hand is a const char * data type.
hence value of p an be changed but the value p points to
cannot be changed.




i dont know the answer!!! :P

Is This Answer Correct ?    3 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a macro?

1163


What is an array in c?

1097


what is the diffrenet bettwen HTTP and internet protocol

1884


What is the use of bitwise operator?

1174


How do I get an accurate error status return from system on ms-dos?

1179


#include { printf("Hello"); } how compile time affects when we add additional header file .

1942


What is modeling?

1097


Which is more efficient, a switch statement or an if else chain?

1081


What is #line in c?

1074


What is unary operator?

1176


Can you write the function prototype, definition and mention the other requirements.

1197


What is the heap?

1258


How would you rename a function in C?

1091


Are the variables argc and argv are always local to main?

1082


Write a program for Overriding.

1214