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

Answer Posted / singamsa

we can not access a++ or a-- on array but we can do that in
pointers

array, address is constanct for that string, pointer is not
like that

Is This Answer Correct ?    43 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is integer constants?

802


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

869


What is the difference between variable declaration and variable definition in c?

807


What is the symbol indicated the c-preprocessor?

944


What is a pointer in c?

981


What header files do I need in order to define the standard library functions I use?

755


Why we use stdio h in c?

789


What is memory leak in c?

840


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1160


which type of aspect you want from the student.

1908


can we implement multi-threads in c.

877


Explain what is a 'locale'?

795


What are multidimensional arrays?

871


How do you print only part of a string?

785


Explain a pre-processor and its advantages.

847