-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strrev.c
More file actions
32 lines (29 loc) · 1.08 KB
/
ft_strrev.c
File metadata and controls
32 lines (29 loc) · 1.08 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrev.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ppanchen <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/30 16:18:23 by ppanchen #+# #+# */
/* Updated: 2017/02/19 20:31:54 by ppanchen ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrev(char *str)
{
int i;
int j;
char c;
i = ft_strlen(str) - 1;
j = 0;
while (j < i)
{
c = str[i];
str[i] = str[j];
str[j] = c;
j++;
i--;
}
return (str);
}