Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2024 | ||
3 | ** my_char_is | ||
4 | ** File description: | ||
5 | ** Returns 1 if the characters (c) is in the characters list (char_list) | ||
6 | ** or 0 if not | ||
7 | */ | ||
8 | /** | ||
9 | * @file my_char_is.c | ||
10 | * @brief The file containing the my_char_is function | ||
11 | * @author Nicolas TORO | ||
12 | */ | ||
13 | |||
14 | #include "my.h" | ||
15 | |||
16 | 1430999 | int my_char_is(char c, const char *char_list) | |
17 | { | ||
18 |
2/2✓ Branch 0 taken 5278041 times.
✓ Branch 1 taken 1402496 times.
|
6680537 | for (int i = 0; char_list[i]; i++) |
19 |
2/2✓ Branch 0 taken 28503 times.
✓ Branch 1 taken 5249538 times.
|
5278041 | if (c == char_list[i]) |
20 | 28503 | return 1; | |
21 | 1402496 | return 0; | |
22 | } | ||
23 |