Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


strchr()                 String Function                 strchr()




Find a character in a string

#include <string.h>

char *strchr(string, character);
char *string; int character;

strchr  searches for  the  first occurrence  of character  within
string.   The null  character at  the end  of string  is included
within the search.  It is equivalent to the COHERENT function in-
dex.

strchr  returns a  pointer to the  first occurrence  of character
within string.  If character is not found, it returns NULL.

Having strchr  search for a null character  will always produce a
pointer to the end of a string.  For example,


        char *string;
        assert(strchr(string, '\0') == string + strlen(string));


never fails.

***** See Also *****

string functions




























COHERENT Lexicon                                           Page 1


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026