narnaud
3 years ago
23 changed files with 119 additions and 14 deletions
@ -0,0 +1,26 @@ |
|||||
|
/* ************************************************************************** */ |
||||
|
/* */ |
||||
|
/* ::: :::::::: */ |
||||
|
/* ft_isnumber.c :+: :+: :+: */ |
||||
|
/* +:+ +:+ +:+ */ |
||||
|
/* By: narnaud@student.42nice.fr <marvin@42.fr> +#+ +:+ +#+ */ |
||||
|
/* +#+#+#+#+#+ +#+ */ |
||||
|
/* Created: 2022/05/18 16:18:15 by narnaud@stude #+# #+# */ |
||||
|
/* Updated: 2022/05/18 16:21:52 by narnaud@stude ### ########.fr */ |
||||
|
/* */ |
||||
|
/* ************************************************************************** */ |
||||
|
|
||||
|
#include "../libft.h" |
||||
|
|
||||
|
int ft_isnumber(char *str) |
||||
|
{ |
||||
|
if (*str == '-' || *str == '+') |
||||
|
str++; |
||||
|
while (*str) |
||||
|
{ |
||||
|
if (!ft_isdigit(*str)) |
||||
|
return (0); |
||||
|
str++; |
||||
|
} |
||||
|
return (1); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
/* ************************************************************************** */ |
||||
|
/* */ |
||||
|
/* ::: :::::::: */ |
||||
|
/* ft_max.c :+: :+: :+: */ |
||||
|
/* +:+ +:+ +:+ */ |
||||
|
/* By: narnaud@student.42nice.fr <marvin@42.fr> +#+ +:+ +#+ */ |
||||
|
/* +#+#+#+#+#+ +#+ */ |
||||
|
/* Created: 2022/05/07 22:56:56 by narnaud@stude #+# #+# */ |
||||
|
/* Updated: 2022/05/07 22:57:21 by narnaud@stude ### ########.fr */ |
||||
|
/* */ |
||||
|
/* ************************************************************************** */ |
||||
|
|
||||
|
#include "../libft.h" |
||||
|
|
||||
|
int ft_max(int a, int b) |
||||
|
{ |
||||
|
if (a > b) |
||||
|
return (a); |
||||
|
else |
||||
|
return (b); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
/* ************************************************************************** */ |
||||
|
/* */ |
||||
|
/* ::: :::::::: */ |
||||
|
/* ft_min.c :+: :+: :+: */ |
||||
|
/* +:+ +:+ +:+ */ |
||||
|
/* By: narnaud@student.42nice.fr <marvin@42.fr> +#+ +:+ +#+ */ |
||||
|
/* +#+#+#+#+#+ +#+ */ |
||||
|
/* Created: 2022/05/07 22:56:56 by narnaud@stude #+# #+# */ |
||||
|
/* Updated: 2022/05/09 08:58:50 by narnaud ### ########.fr */ |
||||
|
/* */ |
||||
|
/* ************************************************************************** */ |
||||
|
|
||||
|
#include "../libft.h" |
||||
|
|
||||
|
int ft_min(int a, int b) |
||||
|
{ |
||||
|
if (a < b) |
||||
|
return (a); |
||||
|
else |
||||
|
return (b); |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
/* ************************************************************************** */ |
||||
|
/* */ |
||||
|
/* ::: :::::::: */ |
||||
|
/* ft_join_with.c :+: :+: :+: */ |
||||
|
/* +:+ +:+ +:+ */ |
||||
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */ |
||||
|
/* +#+#+#+#+#+ +#+ */ |
||||
|
/* Created: 2022/05/17 09:44:59 by narnaud #+# #+# */ |
||||
|
/* Updated: 2022/05/17 09:56:37 by narnaud ### ########.fr */ |
||||
|
/* */ |
||||
|
/* ************************************************************************** */ |
||||
|
|
||||
|
#include "../libft.h" |
||||
|
|
||||
|
char *ft_strjoin_with(char *s1, char *s2, char *inter) |
||||
|
{ |
||||
|
int path_length; |
||||
|
char *ret; |
||||
|
|
||||
|
path_length = ft_strlen(s1) + ft_strlen(s2) + ft_strlen(inter) + 1; |
||||
|
ret = ft_calloc(path_length, sizeof(char)); |
||||
|
ft_memcpy(ret, s1, ft_strlen(s1)); |
||||
|
ft_memcpy(ret + ft_strlen(s1), inter, ft_strlen(inter)); |
||||
|
ft_memcpy(ret + ft_strlen(s1) + ft_strlen(inter), \ |
||||
|
s2, ft_strlen(s2)); |
||||
|
return (ret); |
||||
|
} |
Loading…
Reference in new issue