What is the difference between char a[] = "string"; and
char *p = "string"; ?

Answer Posted / praveenkumar managuli

char s[]; this allocate memory equal tosize of string
and char *s; holds the address of first charecter

Is This Answer Correct ?    23 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

`write a program to display the recomended action depends on a color of trafic light using nested if statments

1622


What is static memory allocation? Explain

618


How do you use a pointer to a function?

619


Explain enumerated types.

588


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2641






I need a sort of an approximate strcmp routine?

647


what does static variable mean?

641


What is the meaning of c in c language?

586


What is a stream in c programming?

578


Write a program to swap two numbers without using the third variable?

587


to find the closest pair

1812


How do I copy files?

612


How can I automatically locate a programs configuration files in the same directory as the executable?

614


What is this infamous null pointer, anyway?

596


Explain how can I make sure that my program is the only one accessing a file?

606