Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_list_size | ||
4 | ** File description: | ||
5 | ** Returns the size of a linked list | ||
6 | */ | ||
7 | /** | ||
8 | * @file my_list_size.c | ||
9 | * @brief The file containing the my_list_size function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "mylist.h" | ||
14 | |||
15 | 3 | int my_list_size(node_t const *begin) | |
16 | { | ||
17 | 3 | int nb = 0; | |
18 | |||
19 |
2/2✓ Branch 0 taken 9 times.
✓ Branch 1 taken 3 times.
|
12 | for (; begin != NULL; nb++) |
20 | 9 | begin = begin->next; | |
21 | 3 | return nb; | |
22 | } | ||
23 |