count_char()
#
The function count_char()
counts the occurrences of a specified character in a given string.
Prototype
int count_char(const char *s, char c);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The input string in which occurrences of |
|
|
The character to count within the string |
Return Value
Returns the number of times the character c
appears in the string s
.
Notes
If s
is NULL, the behavior is undefined. The function does not modify the input string.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples