-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strrev.c
More file actions
31 lines (29 loc) · 1.08 KB
/
ft_strrev.c
File metadata and controls
31 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrev.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ibohonos <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/10/30 15:57:01 by ibohonos #+# #+# */
/* Updated: 2017/11/06 18:00:35 by ibohonos ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strrev(char *str)
{
int i;
int j;
char k;
i = 0;
j = 0;
while (str[j] != '\0')
j++;
while (i < j / 2)
{
k = str[j - i - 1];
str[j - i - 1] = str[i];
str[i] = k;
i++;
}
return (str);
}