ft_putstr.c 323 B

1234567891011121314151617181920212223242526
  1. /* Create a function that displays a string of characters on the standard output
  2. */
  3. #include <unistd.h>
  4. void ft_putchar(char c)
  5. {
  6. write(1, &c, 1);
  7. }
  8. void ft_putstr(char *str)
  9. {
  10. while(*str)
  11. {
  12. ft_putchar(*str++);
  13. }
  14. ft_putchar(10);
  15. }
  16. int main(void)
  17. {
  18. ft_putstr("Hello, World");
  19. ft_putstr("Hi");
  20. return (0);
  21. }