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

What are proxy objects in c++?

1132


How does java differ from c and c++?

931


What does it mean to declare a member function as virtual?

1014


Who made c++?

1015


What do you mean by public protected and private in c++?

1002


Is c++ fully object oriented?

921


Difference between pass by value and pass by reference?

1089


Can we overload operator in c++?

982


Using a smart pointer can we iterate through a container?

1026


Who created c++?

1012


Is java the same as c++?

941


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

1094


What are the characteristics of friend functions?

971


What is constructor c++?

1067


What are friend classes?

1017