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 *p = "string"; ?

Answer Posted / aravind

hi im answering as far as i know , pls say ur feedback,,,(+_+)
Array:
for char array char a[]; no such array size is accepted by
the compiler. That is , it requires a fixed size for the
array like: char a[20];

in this case the number of strings / characters it can hold
is only upto 20 while if it exceeds , the input strings get
truncated. [STATIC MEMORY ALLOCATION AND TRAVERSAL WITHIN
BOUNDS]

Pointer:
Whereas in case of pointers it is of DYNAMIC MEMORY type and
infinite storage when compared to Array. and predefinition ,
truncation are absent.
Also TRAVERSAL is easy.

Is This Answer Correct ?    6 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what type of questions arrive in interview over c programming?

1992


How can you avoid including a header more than once?

939


all c language question

2396


Why c is procedure oriented?

1014


When was c language developed?

1150


What is the heap?

1172


What is the size of array float a(10)?

1105


In C, What is the #line used for?

2135


Difference between MAC vs. IP Addressing

1111


What is difference between constant pointer and constant variable?

1233


What is dynamic dispatch in c++?

1022


What is wrong with this program statement?

1001


How do we open a binary file in Read/Write mode in C?

1207


Explain the use of fflush() function?

1040


How do I use strcmp?

1034