You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <unistd.h>
int blank(char c)
{
if (c == ' ' || c == '\t')
return(1);
return(0);
}
int main(int ac, char **av)
{
unsigned int i;
i = 0;
if (ac == 2)
{
while (av[1][i])
i++;
i--;
while (i > 0 && blank(av[1][i]))
i--;
while (i > 0 && !blank(av[1][i]))
i--;
while (av[1][i] && blank(av[1][i]))
i++;
while (av[1][i] && !blank(av[1][i]))
{
write(1, &av[1][i], 1);
i++;
}
}
write(1, "\n", 1);
return(0);
}
The text was updated successfully, but these errors were encountered:
Before:
$>bcd$
$>./last_word "abcd" | cat -e
I correct this problem, by adding
last_word.c
The text was updated successfully, but these errors were encountered: