files dans srcs sans dossier
This commit is contained in:
26
srcs/ft_issort.c
Normal file
26
srcs/ft_issort.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 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);
|
||||
}
|
||||
Reference in New Issue
Block a user