-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_get_rank.c
23 lines (20 loc) · 1.03 KB
/
ft_get_rank.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_get_rank.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/06/07 13:00:48 by thifranc #+# #+# */
/* Updated: 2016/06/07 13:02:11 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_get_rank(int *tab, int value, int size)
{
int i;
i = 0;
while (tab[i] != value && i < size)
i++;
return (i == size ? -1 : i);
}