42_C_PISCINE/Rush/Rush02/ex00/ft_reverse_str.c
Camille Chauvet 29ed24d567 init
2023-05-17 16:45:25 +00:00

32 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_reverse_str.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nlauvray <nlauvray@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/31 08:35:22 by nlauvray #+# #+# */
/* Updated: 2022/07/31 08:35:29 by nlauvray ### ########.fr */
/* */
/* ************************************************************************** */
#include "rush02.h"
char *ft_reverse_str(char *str)
{
int i;
int size;
char tempo;
size = ft_strlen(str);
i = 0;
while (i < size / 2)
{
tempo = str[i];
str[i] = str[size - i - 1];
str[size - i - 1] = tempo;
i++;
}
return (str);
}