Find a character in a string
#include <strings.h>
char* index( const char* s,
int c );
libc
The index() function returns a pointer to the first occurrence of the character c in the string s. This function operates on null-terminated strings. The null character is considered to be part of the string.
A pointer to the character, or NULL if the character doesn't occur in the string.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |