MicrOS
strchr.c File Reference
#include "../string.h"

Functions

char * strchr (const char *str, int character)
 Locate first occurrence of character in string. More...
 

Function Documentation

◆ strchr()

char* strchr ( const char *  str,
int  character 
)

Locate first occurrence of character in string.

Returns a pointer to the first occurrence of character in the C string str.

Parameters
strC string.
characterCharacter to be located. It is passed as its int promotion, but it is internally converted back to char for the comparison.
Returns
A pointer to the first occurrence of value in the block of memory pointed by ptr. If the value is not found, the function returns a null pointer.