|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Find a character in a string
#include <strings.h> char* index( const char* s, int c );
- The string you want to search. This string must end with a null (\0) character. The null character is considered to be part of the string.
- The character you're looking for.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The index() function returns a pointer to the first occurrence of the character c in the string s.
A pointer to the character, or NULL if the character doesn't occur in the string.