next up previous contents index
Next: 9.4.19 strings.h: string handling Up: 9.4 Header Files Previous: 9.4.17 stdlib.h: standard library

9.4.18 string.h: string handling functions

   

DESCRIPTION

This header file defines the symbol NULL if it hasn't been defined already, and provides prototypes for the following functions in the minimal C library:
memcpy
  Copy data from one location in memory to another. Our implementation behaves correctly when source and destination overlap.
memmove
Like memcpy but is guaranteed to behave correctly when source and destination overlap.
memset
  Set the contents of a block of memory to a uniform value.

strlen
  Find the length of a null-terminated string.
strcpy
Copy a string to another location in memory.
strncpy
Copy a string, up to a specified maximum length.
strdup
Return a copy of a string in newly-allocated memory. Depends on malloc, Section 9.5.2.
strcat
Concatenate a second string onto the end of a first.
strncat
Concatenate two strings, up to a specified maximum length.
strcmp
  Compare two strings.
strncmp
Compare two strings, up to a specified maximum length.

strchr
Find the first occurrence of a character in a string.
strrchr
Find the last occurrence of a character in a string.
strstr
Find the first occurrence of a substring in a larger string.
strtok
  Scan for tokens in a string. Not thread safe; uses static data.
strpbrk
Locate the first occurrence in a string of one of several characters.
strspn
Find the length of an initial span of characters in a given set.
strcspn
Measure a span of characters not in a given set.
strerror
Returns a pointer to a message string for an error number.

The following deprecated functions are provided for compatibility with existing code:

bcopy
Copy data from one location in memory to another.
bzero
Clear the contents of a memory block to zero.
index
Find the first occurrence of a character in a string.
rindex
Find the last occurrence of a character in a string.


next up previous contents index
Next: 9.4.19 strings.h: string handling Up: 9.4 Header Files Previous: 9.4.17 stdlib.h: standard library

University of Utah Flux Research Group