42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
my_get_char_index.c File Reference

The file containing the my_get_char_index function. More...

#include "my.h"

Functions

int my_get_char_index (char *str, char c, int occurrence)
 Get the index of a char in a str according to its occurrence.
 

Detailed Description

The file containing the my_get_char_index function.

Author
Nicolas TORO

Function Documentation

◆ my_get_char_index()

int my_get_char_index ( char * str,
char c,
int occurrence )

Get the index of a char in a str according to its occurrence.

Parameters
strThe string to check
cThe letter to find
occurrenceThe occurrence of the letter to find
Returns
int -1 if the letter is not found, otherwise the index of the letter in the string