-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putstr_fd.c
27 lines (24 loc) · 1.24 KB
/
ft_putstr_fd.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: crea <crea@student.42roma.it> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/18 20:11:03 by crea #+# #+# */
/* Updated: 2024/02/05 14:42:05 by crea ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/* ft_putstr_fd:
** Writes the string 'str' to the file descriptor 'fd'.
** The function iterates through each character of the string and writes it to 'fd'.
** It continues until the null terminator of the string is reached.
*/
void ft_putstr_fd(char *str, int fd)
{
int i;
i = 0;
while (str[i])
write(fd, &str[i++], 1);
}