-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_revstr.c
25 lines (22 loc) · 1.06 KB
/
ft_revstr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_revstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anpayot <anpayot@student.42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/17 18:34:57 by anpayot #+# #+# */
/* Updated: 2024/10/23 13:26:26 by anpayot ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_revstr(char *str, size_t len)
{
char *start;
char *end;
start = str;
end = str + len - 1;
while (start < end)
ft_swap(start++, end--);
return (str);
}