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 | 9 | int my_char_is(char c, const char *char_list) | |
17 | { | ||
18 |
2/2✓ Branch 0 taken 16 times.
✓ Branch 1 taken 2 times.
|
18 | for (int i = 0; char_list[i]; i++) |
19 |
2/2✓ Branch 0 taken 7 times.
✓ Branch 1 taken 9 times.
|
16 | if (c == char_list[i]) |
20 | 7 | return 1; | |
21 | 2 | return 0; | |
22 | } | ||
23 |