ft_putchar_fd: initial implementation
This commit is contained in:
parent
6a186f7527
commit
28cadf55f1
3 changed files with 31 additions and 2 deletions
5
Makefile
5
Makefile
|
|
@ -6,7 +6,7 @@
|
|||
# By: kcolin <marvin@42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2024/10/14 13:43:59 by kcolin #+# #+# #
|
||||
# Updated: 2024/10/18 12:11:14 by kcolin ### ########.fr #
|
||||
# Updated: 2024/10/18 14:27:44 by kcolin ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
|
|
@ -41,7 +41,8 @@ SOURCES = ft_isalpha.c \
|
|||
ft_split.c \
|
||||
ft_itoa.c \
|
||||
ft_strmapi.c \
|
||||
ft_striteri.c
|
||||
ft_striteri.c \
|
||||
ft_putchar_fd.c
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
CC = gcc
|
||||
|
||||
|
|
|
|||
26
ft_putchar_fd.c
Normal file
26
ft_putchar_fd.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putchar_fd.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/18 12:13:05 by kcolin #+# #+# */
|
||||
/* Updated: 2024/10/18 14:06:11 by kcolin ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putchar_fd(char c, int fd)
|
||||
{
|
||||
write(fd, &c, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
int main(void)
|
||||
{
|
||||
ft_putchar_fd('c', 1);
|
||||
return (0);
|
||||
}
|
||||
*/
|
||||
2
libft.h
2
libft.h
|
|
@ -57,4 +57,6 @@ char *ft_itoa(int n);
|
|||
char *ft_strmapi(char const *s, char (*f)(unsigned int, char));
|
||||
void ft_striteri(char *s, void (*f)(unsigned int, char*));
|
||||
|
||||
void ft_putchar_fd(char c, int fd);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue