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

Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1929


Explain container class.

1214


What is the cout in c++?

1024


What is meant by entry controlled loop?

1078


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

1046


Explain the difference between new() and malloc() in c++?

1097


Explain the register storage classes in c++.

1170


What is a container class?

1081


Is c++ a good beginners programming language?

1030


Is swift a good first language?

1015


What are the benefits of c++?

1016


What is abstract class in c++?

1007


What are namespaces in c++?

1056


What are all predefined data types in c++?

1086


Is c++ a dying language?

1124