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 #include iomanip?

1063


How do you invoke a base member function from a derived class in which you have not overridden that function?

1184


What is constructor in C++?

1143


Can a new be used in place of old mallocq? If yes, why?

1143


What are libraries in c++?

1131


Do you know what is overriding?

1295


What are all predefined data types in c++?

1171


What it is and how it might be called (2 methods).

1260


What is the difference between prefix and postfix versions of operator++()?

1134


If you don’t declare a return value, what type of return value is assumed?

1006


What is a terminating character in c++?

1444


What is the main function c++?

1172


How the endl and setw manipulator works?

1053


What is function overloading c++?

1135


Explain mutable storage class specifier.

1126