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

Why c++ is the best language?

1008


When does a name clash occur in c++?

1112


Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()

1469


What is the benefit of encapsulation?

1021


Is facebook written in c++?

948


Explain overriding.

954


Why is c++ still used?

1014


Can you please explain the difference between using macro and inline functions?

999


Should the member functions which are made public in the base class be hidden?

967


why is iostream::eof inside a loop condition considered wrong?

1011


What is a tree in c++?

920


How would you implement a substr() function that extracts a sub string from a given string?

995


How is objective c different from c++?

1196


Write a Program to find the largest of 4 no using macros.

1034


Which programming language is best?

937