What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / ashok
Pointers are fine a cannot be changed p can be changed.
I have a doubt like is there any difference in memory
allocation.
I heard like a gets its memory in local stack and p gets in
data section.
I don get the clear explanation
Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Explain how do you print an address?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What is an example of structure?
Why #include is used in c language?
Did c have any year 2000 problems?
What is the return type of sizeof?
How can I list all of the predefined identifiers?
How main function is called in c?
If fflush wont work, what can I use to flush input?
What are the disadvantages of external storage class?
What is variable declaration and definition in c?
What is the use of a static variable in c?
Is c language still used?
What is typedf?
What is gets() function?