-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strrev.c
33 lines (31 loc) · 1.07 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
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrev.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tyassine <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/15 20:40:24 by tyassine #+# #+# */
/* Updated: 2016/06/21 11:17:41 by tyassine ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strrev(char *str)
{
int i;
int j;
char aux;
i = 0;
j = 0;
while (str[j])
j++;
j--;
while (i < j)
{
aux = str[i];
str[i] = str[j];
str[j] = aux;
i++;
j--;
}
return (str);
}