\0 is the null terminator character.
"\0" matches {'\0', '\0'} . This is a string written by an intricate programmer who does not understand that string literals always have zero termination automatically. Correctly written code would be "" .
The if (str_temp=='\0') line if (str_temp=='\0') is stupid, it should be if (str_temp==NULL) . Now that this happens, \0 equivalent to 0, which is the constant of the null pointer, so the code works out of luck.
Taking a strlen string, where \0 is the first character, is not very significant. You will get zero string length.
Lundin
source share