-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strrev.c
31 lines (28 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
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrev.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ylagtab <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/10 18:44:51 by ylagtab #+# #+# */
/* Updated: 2019/04/10 18:47:55 by ylagtab ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_strrev(char *s)
{
size_t i;
size_t j;
char tmp;
i = 0;
j = ft_strlen(s) - 1;
while (i < j)
{
tmp = s[i];
s[i] = s[j];
s[j] = tmp;
i++;
j--;
}
}