-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_putbits.c
More file actions
28 lines (25 loc) · 1.04 KB
/
ft_putbits.c
File metadata and controls
28 lines (25 loc) · 1.04 KB
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
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putbits.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jagarcia <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/07 22:11:37 by jagarcia #+# #+# */
/* Updated: 2017/11/08 22:50:59 by jagarcia ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putbits(char src)
{
size_t i;
i = 0;
while (i < 8)
{
if (src & (1 << (8 - i - 1)))
ft_putnbr(1);
else
ft_putnbr(0);
i++;
}
}