strlen sometimes equal to sizeof for null-terminated strings
问题 I know that strlen counts the number of characters up until (and excluding) the null character '\0' (or 0 ) and that sizeof gives the amount of space needed to store the string including the null character, but am confused with the output of my code. Question: I expect the result of strlen to be consistently 1 less than the result of sizeof because my strings are null-terminated, but it only seems to be the case for the string of length 4 and 8, excluding '\0' (i.e. the 3rd and 5th results