InterviewSolution
Saved Bookmarks
| 1. |
What type of initialization is needed for the segment “ptr[3] = ‘3’;” to work?(a) char *ptr = “Hello!”;(b) char ptr[] = “Hello!”;(c) both char *ptr = “Hello!”; and char ptr[] = “Hello!”;(d) none of the mentionedThis question was posed to me in examination.The origin of the question is Character Pointers and Functions in portion Pointers and Arrays in C of C |
|
Answer» The correct choice is (B) char PTR[] = “Hello!”; |
|