7.1.4 Support for String Handling
The library includes the header files <string.h> and <strings.h>, which provide the following functions for string handling beyond those required.
- string.h
- strdup(), which duplicates a string by dynamically allocating memory and copying the string to this allocated memory
- strcmp() and strncmp(), which perform case-sensitive string comparisons
- memcpy(), which copies memory from one location to another
- memcmp(), which compares sections of memory
- strings.h
- bcmp(), which is equivalent to memcmp()
- bcopy(), which is equivalent to memmove()
- bzero(), which is equivalent to memset(.., 0, ...);
- ffs(), which finds the first bit set and returns the index of that bit
- index(), which is equivalent to strchr()
- rindex(), which is equivalent to strrchr()
- strcasecmp() and strncasecmp(), which perform case-insensitive string comparisons