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 / sushant mahajan

Ohk... dudes I think that 'C' in Char a[] is a typo. The only difference I can see is this:

char *a="string";
printf("%d", sizeof(a));
/*will print 2 or 4, whatever is the memory assigned to a pointer*/

char a[]="string";
printf("%d", sizeof(a));
/*will print 7 - 1 byte for each character+1 byte for the '\0' */

So basically its a memory thing :D

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define pure virtual function?

1004


What are different types of loops in c++?

1138


State the difference between delete and delete[].

1120


Where the memory to the static variables is allocated?

1074


How a modifier is similar to mutator?

1193


What are the differences between java and c++?

1099


Is it possible to use a new for the reallocation of pointers ?

1067


What is singleton class in c++?

1059


What is a c++ map?

1425


What is scope resolution operator in c++ with example?

1050


how to explain our contribution in the project?

3712


Is c++ a difficult language?

1141


Difference between overloaded functions and overridden functions

1071


What is function declaration in c++ with example?

1116


Which software is used for c++ programming?

1090