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
*a=”String”

Answer Posted / prasant nayak

differences are as follows
1.
Char a[]="string"; //invalid, coz--its not 'Char' but
its 'char' , i.e its syntaticaly incorrect


char *a="string";//it correct

2.
char a[]="string";

above 'a' is an array of characters , where we can change
the string, its not a constant.
i.e we can do a[3] = 'Z';

char *a = "string";

above 'a' is a string constant where we can't change the
string i.e we can't do a[3] = 'Z';

Is This Answer Correct ?    42 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of endl in c++?

984


What is a responder chain?

1024


What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?

1077


What is setfill c++?

1108


Why c++ is called oop?

1065


Why is c++ so fast?

987


What are the benefits of oop in c++?

1149


what are the iterator and generic algorithms.

2110


What is the type of 'this' pointer? When does it get created?

919


How do you clear a set in c++?

1030


What is iomanip c++?

1027


Difference between overloaded functions and overridden functions

1017


Do the names of parameters have to agree in the prototype, definition, and call to the function?

1000


What is & in c++ function?

1018


Does a derived class inherit or doesn't inherit?

1052