-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathft_printf_bonus.h
More file actions
35 lines (28 loc) · 1.84 KB
/
ft_printf_bonus.h
File metadata and controls
35 lines (28 loc) · 1.84 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
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gabrodri <gabrodri@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/12 19:52:47 by gabrodri #+# #+# */
/* Updated: 2023/10/12 19:52:51 by gabrodri ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_PRINTF_BONUS_H
# define FT_PRINTF_BONUS_H
# include <stdarg.h> // for the veriadic arguments handling
#include <unistd.h> // for the write function
/* Remodeled `printf` function, handles `%c`, `%s`, `%p`, `%d`, `%u`, `%x`, `%X`, `%%`, don´t handle
* any buffer for better I/O efficiency*/
int ft_printf(const char *format, ...);
/* Is a recursive function that prints the digits of an unsigned long long integer `n` either in
* decimal or hexadecimal format. It has two main modes of operation:
- Decimal Mode: If the `hexDigits` parameter is `NULL`, the function operates in decimal mode
and prints the digits of `n` in base 10 (decimal).
- Hexadecimal Mode: If the `hexDigits` parameter is not `NULL`, the function operates in
hexadecimal mode and prints the digits of `n` in base 16 (hexadecimal). */
void printDigits(unsigned long long n, const char hexDigits);
/* This function returns the lengh of the string */
unsigned int ft_strlen(char *str);
#endif