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

Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80

3068


Explain what’s a signal? Explain what do I use signals for?

1055


How can I get the current date or time of day in a c program?

1167


What is the difference between scanf and fscanf?

1202


write a program for the normal snake games find in most of the mobiles.

2219


please send me the code for multiplying sparse matrix using c

2122


Explain how can I remove the trailing spaces from a string?

994


What does it mean when the linker says that _end is undefined?

1043


Is it fine to write void main () or main () in c?

968


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3640


What is string length in c?

1029


What are the different types of constants?

1020


Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings

2697


When can a far pointer be used?

968


What is the difference between functions abs() and fabs()?

1087