5.29 Structures5 Notes5.27 Function pointers5.28 String Functions

5.28 String Functions

C standard library string function assume that the string is null terminated.

#include <string.h>
strcpy Copy a string to another location
strncpy Copy a limited string to another location
strcat Concatenate strings
strncat Concatenate a limited string to another
strcmp compares two strings
strncmp compares two strings up to a limit
strchr Find the first specific character in a string
strrchr Find the last specific character in a string
strlen Find length of string

Other string functions: strspn, strcspn, strpbrk, strstr, and strtok.

There is also a set of functions for wide characters.


Instructor: ltaber@pima.edu ** My new Home at GeoApps in Tucson ** The Pima College Site

5.29 Structures5 Notes5.27 Function pointers5.28 String Functions