What is the output of the following C program?
#include <stdio.h>
#include <string.h>
int main(void) {
char s[] = "ab\0cd";
printf("%zu %zu\n", sizeof s, strlen(s));
return 0;
}
The array holds a, b, \0, c, d and the automatic \0: 6 bytes. strlen() stops at the first zero byte, after 2 characters.