Vidyalelo
C Programming · Q94

Arrays and Strings

Programming · C Programming · question 94

Q94

What will be the output of the following C code? const char pla[] = "string1"; const char src[] = "string2"; printf("Before memmove place= %s, src = %s ", pla, src); memmove(pla, src, 7); printf("After memmove place = %s, src = %s ", pla, src);

A.
Before memmove place= string1, src = string2 After memmove place = string2, src = string2
Answer
B.
Before memmove place = string2, src = string2 After memmove place= string1, src = string2
C.
Before memmove place = string2, src = string1 After memmove place= string2, src =string2
D.
Before memmove place= string1, src = string2 After memmove place=string1, src = string1

Answer: Option A

Solution

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