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

What are the advantages of using friend classes?

1144


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

1000


How do you save a c++ program?

1034


Describe linked list using C++ with an example.

1079


Which bitwise operator is used to check whether a particular bit is on or off?

1056


What does n mean in c++?

1158


Which is not a valid keyword a) public b) protected c) guarded

1257


How can we check whether the contents of two structure variables are same or not?

1069


What is istream and ostream in c++?

1125


What is virtual base class?

1077


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

2629


explain the reference variable in c++?

1058


Explain the advantages of using friend classes.

1157


Can circle be called an ellipse?

1075


What is the use of setfill in c++?

1073