Search for the first occurrence of the character ch in the string str.
Search for the first occurrence of the character ch in the string str. The function returns a pointer to the point in the string where the searched character occurs for the first time. If the character is not found, the call returns -1.
Name | Type | Default | Description |
Return | int | 0-based position in the string, at which the searched character occurs for the first
time. -1 : Character not found |
|
str | char* | - | Character string which is to be searched |
ch | char | - | Search for this character. Must not be equal to 0. |
strcpy (str, "Matthias");
strchrpos (str, 't') returns 2
Alphabetic index HTML hierarchy of classes or Java