-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic_functions.c
44 lines (39 loc) · 1.26 KB
/
basic_functions.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* ************************************************************************** */
/* */
/* :::::::: */
/* basic_functions.c :+: :+: */
/* +:+ */
/* By: kstallen <[email protected]> +#+ */
/* +#+ */
/* Created: 2019/08/25 18:57:15 by kstallen #+# #+# */
/* Updated: 2019/08/25 19:00:20 by kstallen ######## odam.nl */
/* */
/* ************************************************************************** */
#include "header.h"
void ft_putchar(char c)
{
write(1, &c, 1);
}
void ft_putstr(char *str)
{
int i;
i = 0;
while (str[i] != '\0')
{
ft_putchar(str[i]);
i++;
}
}
void ft_putnbr(int nb)
{
if (nb < 0)
{
ft_putchar('-');
nb = -nb;
}
if (nb % 10)
{
ft_putnbr(nb / 10);
ft_putchar(nb % 10 + '0');
}
}