Question
Which of the following statements are correct about the below declarations?
char *p = "Sanjay";
char a[] = "Sanjay";
1: There is no difference in the declarations and both serve the same purpose.
2: p is a non-const pointer pointing to a non-const string, whereas a is a const pointer pointing
to a non-const pointer.
3: The pointer p can be modified to point to another string, whereas the individual characters within
array a can be changed.
4: In both cases the '' will be added at the end of the string "Sanjay".
Answer: Option B
Was this answer helpful ?
No answer description available for this question.
Was this answer helpful ?
Submit Solution