42/d06/ex01/ft_print_program_name.c

31 lines
1.1 KiB
C
Raw Permalink Normal View History

2016-11-20 02:20:23 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_program_name.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/02 12:58:06 by gtertysh #+# #+# */
/* Updated: 2016/11/02 19:06:48 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
int ft_putchar(char c);
void ft_putstr(char *str)
{
while (*str)
{
ft_putchar(*str);
str++;
}
}
int main(int argc, char **argv)
{
argc = -argc;
ft_putstr(argv[0]);
ft_putchar('\n');
return (0);
}