#include <unistd.h>
#include <stdio.h>
int ft_strlen(char *str)
{
int i;
i = 0;
while(str[i] != '\0')
i++;
return (i);
}
char *ft_rev_print(char *str)
{
int i;
i = ft_strlen(str);
printf("\n%d\n", (i));
i--;
printf("\n%d\n", (i));
while (i >= 0)
{
write(1, &str[i], 1);
//printf("\n%c\n", str[i]);
i--;
}
// printf("\n%s\n", str);
return(str);
}
int main()
{
char str[] = "Chat";
ft_rev_print(str);
// printf("\n%s\n", str);
// printf("\n%s", ft_rev_print(str));
}
To embed this project on your website, copy the following code and paste it into your website's HTML: