value of first element beyond the end of array?
There is no "first element" beyond the end of the array strarray
. The memory after the array can contain any garbage.
So in general dereferencing memory beyond an array invokes undefined behavior.
If you want that the last element of an array of pointers would be equal to NULL then explicitly specify that. For example
char * strarray[] = {"first", "second", "third", "fourth", "fifth", NULL };
or
char * strarray[6] = {"first", "second", "third", "fourth", "fifth" };
Also as this is an array of string literals that may not be modified then it is better to declare the array with the qualifier const
const char * strarray[] = {"first", "second", "third", "fourth", "fifth", NULL };