String Handling: string.h

The string.h library defines the size_t type and the NULL macro for the null pointer. It provides several functions for analyzing and manipulating character strings and a few that deal with memory more generally. Table F.16 lists the functions.

Table F.16. Localization functions.
PrototypeDescription
void *memchr(const void *s, int c, size_t n);Searches for the first occurrence of c (converted to unsigned char) in the initial n characters of the object pointed to by s; returns a pointer to the first occurrence, NULL if none is found.
int memcmp(const void *s1, const void *s2, size_t n);Compares the first n characters of the object pointed to by s1 to the first n characters of the object pointed to by s2, interpreting each ...

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.