32 lines
1.1 KiB
C
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);
|
||
|
}
|