s
를 파일 디스크립터로 출력void ft_putstr_fd(char *s, int fd);
s
: The string to output.fd
: The file descriptor on which to write.void ft_putstr_fd(char *s, int fd)
{
if (!s || fd < 0)
return ;
while (*s)
{
write(fd, s, 1);
s++;
}
}
#include "libft.h"
void ft_putstr_fd(char *s, int fd)
{
if (!s || fd < 0)
return ;
write(fd, s, ft_strlen(s));
}