ft_putendl_fd

one·2021년 2월 1일
0

✅ft_putendl_fd

  • Outputs the string s to the given file
    descriptor, followed by a newline.
  • ft_putstr_fd + a newline
  • s출력 후 줄바꿈

💾Prototype

void ft_putendl_fd(char *s, int fd);

💻Parameters

  • s : The string to output.
  • fd : The file descriptor on which to write.

💻Return value

  • None

💾Code

#include "libft.h"

void	ft_putendl_fd(char *s, int fd)
{
	if (!s || fd < 0)
		return ;
	write(fd, s, ft_strlen(s));
	write(fd, "\n", 1);
}
profile
늘 호기심을 갖고, 새로운 것에 도전할 것.

0개의 댓글