6.29 Structures6 Notes6.27 Function pointers6.28 String Functions

6.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: Louis Taber, louis.taber.at.pima at gmail dot com (520) 206-6850
My web site in Cleveland, OH
The Pima Community College web site

6.29 Structures6 Notes6.27 Function pointers6.28 String Functions