Since a c-string is a null terminated array of characters, the last character of the array must be set to zero, in order to mark the end of the string. Thus the only valid string contained in an array of just one element must be an empty string, of length zero.
Because the data has not been initialised, it contains some garbage value. The strlen function simply searches each successive byte until it finds a zero. Of course by then it will be accessing some other memory which is beyond the end of the array.
1 2 3 4 5
char* ptr_temp = newchar[1];
char temp[1];
ptr_temp[0] = 0; // put terminating zero in last byte of array
temp[0] = 0; // put terminating zero in last byte of array