

MCQOPTIONS
Saved Bookmarks
1. |
Which of the following statements are correct about the below declarations?_x000D_ char *p = "Sanjay";char a[] = "Sanjay";_x000D_ _x000D_ _x000D_ 1:_x000D_ There is no difference in the declarations and both serve the same purpose._x000D_ _x000D_ _x000D_ 2:_x000D_ p is a non-const pointer pointing to a non-const string, whereas a is a const pointer pointing to a non-const pointer._x000D_ _x000D_ _x000D_ 3:_x000D_ The pointer p can be modified to point to another string, whereas the individual characters within array a can be changed._x000D_ _x000D_ _x000D_ 4:_x000D_ In both cases the '\0' will be added at the end of the string "Sanjay". |
A. | 1, 2 |
B. | 2, 3, 4 |
C. | 3, 4 |
D. | 2, 3 |
Answer» C. 3, 4 | |