I am having trouble wrapping my brain around null terminators and non-null terminating arrays.
Let's say I have two declarations:
const char *string = "mike";
and
const char string[4] = {'m', 'i', 'k', 'e'};
I understand the first declaration is because in C, a character array is null terminated because it is a defined to be a contiguous block of characters in memory terminated by a NULL and I can check this with strlen.
The problem that I'm having is understanding declarations like the second, with no null terminator.
How can I check for validity of a string with no null terminator? (as in, what if there are additional values in the array?)
{'m', 'i', 'k', 'e'}instead.