size_t strlen(const char *s);
function returns the length of string s
. It does not count the terminating null
Much like strdup, this str function is another case of code reuse and/or consolidation. It's easy enough to write your own code to find the length of a string (or assume, if you're lazy/stupid), but the library has it so you don't need to. A meat and potatoes function, you'll use it a lot if you deal with strings.