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 time_t c++?

1141


How would you use the functions sin(), pow(), sqrt()?

1193


What are the benefits of c++?

1060


Explain what is oop?

1097


What are the advantage of using register variables?

1175


Is c# written in c++?

988


How compile and run c++ program in turbo c++?

1186


How should runtime errors be handled in c++?

1156


Is c++ a pure oop language?

1085


What is the c++ programming language used for?

1051


What is the basic difference between C and C++?

1185


Is c++ still in demand?

1154


What is the full form of c++?

1355


Explain function overloading and operator overloading.

1086


How are pointers type-cast?

1123