Skip to content

Instantly share code, notes, and snippets.

@zaydek-old
Created February 10, 2017 01:19
Show Gist options
  • Save zaydek-old/44a4f670e7100e1d4261ba466147c8ba to your computer and use it in GitHub Desktop.
Save zaydek-old/44a4f670e7100e1d4261ba466147c8ba to your computer and use it in GitHub Desktop.
#include <string.h>
#include <unistd.h>
size_t ft_strlen(char *s)
{
size_t i;
i = 0;
while (s[i])
++i;
return (i);
}
size_t ft_putstr(char *s)
{
return (write(1, s, ft_strlen(s)));
}
void od_hoot(char *s, int n)
{
if (*s)
ft_putstr(s) && ft_putstr(n ? " " : "\n");
}
int main(int ac, char **av)
{
if (--ac)
while (ac--)
od_hoot(*++av, ac);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment