Consider this code:
char name[]=\"123\"; char name1[]=\"1234\";
And this result
The size of name (char[]):4 The size of n
Because there is a null character that is attached to the end of string in C.
Like here in your case
name[0] = '1' name[1] = '2' name[2] = '3' name[3] = '\0' name1[0] = '1' name1[1] = '2' name1[2] = '3' name1[3] = '4' name1[4] = '\0'