#include<stdio.h>
#include<string.h>
int main()
{
char ptr[]= {'a','b','c','0','e'};
char str[]= "abc0e";
printf("\nptr = %s\t len = %d\n",ptr, strlen(ptr));
printf("\nstr = %s\t len = %d\n",str, strlen(str));
return 0;
}
Output : ptr = abc0e len = 6
str = abc0e len = 5
Why the length for ptr is 6 ? Can someone please explain it ?