String Library (string.h)
`strlen`, `strcpy`, `strncpy`, `strcat`, `strcmp`, `strchr`, `strstr`, `memcpy`, `memset`, `memcmp`.
Easy
Prefer bounded versions and snprintf(buf, sizeof buf, "%s-%d", a, b) for building strings. strncpy doesn't always add '\0' — terminate manually.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.