Vidyalelo
C Programming · Q244

Pointer

Programming · C Programming · question 244

Q244

What type of initialization is needed for the segment "ptr[3] = '3';" to work?

A.
char *ptr = "Hello!";
B.
char ptr[] = "Hello!";
Answer
C.
both char *ptr = "Hello!"; and char ptr[] = "Hello!";
D.
none of the mentioned

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board