-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strrev.c
31 lines (28 loc) · 1.17 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
/* ************************************************************************** */
/* LE - / */
/* / */
/* ft_strrev.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: rcabotia <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2018/10/10 12:16:59 by rcabotia #+# ## ## #+# */
/* Updated: 2018/10/10 17:24:47 by rcabotia ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrev(char *str)
{
int i;
int length;
char temp;
i = -1;
length = ft_strlen(str);
while (++i < --length)
{
temp = str[i];
str[i] = str[length];
str[length] = temp;
}
return (str);
}