-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_strrev.c
28 lines (25 loc) · 1.06 KB
/
ft_strrev.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
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrev.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: smonroe <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/21 16:45:34 by smonroe #+# #+# */
/* Updated: 2018/04/21 16:52:41 by smonroe ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_strrev(char *s)
{
int l;
int i;
l = ft_strlen(s);
i = -1;
while (++i < l / 2)
{
s[l - i - 1] ^= s[i];
s[i] ^= s[l - i - 1];
s[l - i - 1] ^= s[i];
}
}