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 / anshul

I guess the main difference for which interviewer was looking for it that name of the array is constant pointer and character pointer is not. So, if
char a1[]="string";
char *a2="string";

a2=a1;//Compiles and works perfectly
a1=a2;//Error caught at compile time

This is a famous example and is available in many C books.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which field is used in c++?

1150


What is the full form of ios?

1136


Write a note about the virtual member function?

1108


What are activex and ole?

1110


What is searching?

1194


What are maps in c++?

1004


You want to link a c++ program to c functions. How would you do it?

1039


What is the best way to declare and define global variables?

1412


Why main function is special in c++?

1171


What is the difference between structures and unions?

1115


Explain object slicing in c++?

1121


How many types of modularization are there in c++?

1120


What is the use of vtable?

1192


What is the use of setfill in c++?

1122


What are built-in functions? What is the syntax for the definition?

1134