-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf_utils.c
37 lines (33 loc) · 1.11 KB
/
ft_printf_utils.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wdelaros <wdelaros@student.42quebec.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/07 12:12:32 by wdelaros #+# #+# */
/* Updated: 2022/11/09 13:46:54 by wdelaros ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_intlen(long int n, int base)
{
int i;
i = 1;
if (n < 0)
{
n *= -1;
i++;
}
while (n > (base - 1))
{
n /= base;
i++;
}
return (i);
}
int ft_printchar(int c)
{
ft_putchar_fd(c, 1);
return (1);
}