I am learning C. And, I see this function find length of a string.
size_t strlen(const char *str)
{
size_t len = 0U;
while(*(str++)) ++len; return len;
}
Now, when does the loop exit? I am confused, since str++, always increases the pointer.
NULcharacter which has the value of0falsein C and anything else istrue.So we keep incrementing the pointer into the string and the length until we find a
NULand then return.