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\n", pla, src);
memmove(pla, src, 7);
printf("After memmove place = %s, src = %s\n", pla, src);
const char pla[] = "string1";
const char src[] = "string2";
printf("Before memmove place= %s, src = %s\n", pla, src);
memmove(pla, src, 7);
printf("After memmove place = %s, src = %s\n", pla, src);
A. Before memmove place= string1, src = string2 After memmove place = string2, src = string2
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
Related Questions on Arrays and Strings
Join The Discussion