104. Strings and Character Handling-i

Question.7

A developer uses strncpy for a safe copy:

char buf[8];
strncpy(buf, "FIRMWARE_V2", sizeof(buf));
printf("%s", buf);

The source string (11 chars + \0) is longer than the buffer (8). What happens?

Need Help? Refer to the Quick Guide below

Select Answer