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

Answer Posted / mak

in case of array size of it become fixed after initialization,
so a string of length greater than the size of previous string can't be assigned to array.
on the other hand pointer can take variable size string as it stores only the first address.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are variables and it what way is it different from constants?

765


any "C" function by default returns an a) int value b) float value c) char value d) a & b

655


What is pointer and structure in c?

553


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

701


What is unsigned int in c?

545






The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

749


What is typeof in c?

590


What tq means in chat?

569


How can I use a preprocessorif expression to ?

589


Process by which one bit pattern in to another by bit wise operation is?

606


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

3720


Explain what is wrong with this program statement? Void = 10;

754


What is auto keyword in c?

778


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1443


What is a lookup table in c?

611