27 lines
1.1 KiB
C
27 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_issort.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2018/11/16 15:18:14 by hulamy #+# #+# */
|
|
/* Updated: 2018/11/16 15:18:15 by hulamy ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
int ft_issort(int *tab, int length, int (*f)(int, int))
|
|
{
|
|
int i;
|
|
|
|
i = -1;
|
|
if (!tab)
|
|
return (0);
|
|
while (++i < length - 1)
|
|
if (f(tab[i], tab[i + 1]) > 0)
|
|
return (0);
|
|
return (1);
|
|
}
|