write 함수로 숫자 출력

쿵ㅇ양·2023년 8월 16일

알고리즘

목록 보기
13/18

1~9 출력하기

write함수에는 문자형만!

char형을 썼으니 ''로 감싸주기

#include <unistd.h>

void	ft_print_numbers(void)
{
	char	a;

	a = '0';
	while (a <= '9')
	{
		write(1, &a, 1);
		a++;
	}
}
profile
개발을 공부하고 있는 대학생

0개의 댓글