Bonus preparartion
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -53,3 +53,5 @@ dkms.conf
|
|||||||
|
|
||||||
# debug information files
|
# debug information files
|
||||||
*.dwo
|
*.dwo
|
||||||
|
|
||||||
|
.build/
|
||||||
|
|||||||
41
Makefile
41
Makefile
@@ -1,6 +1,9 @@
|
|||||||
NAME= libftprintf.a
|
NAME= libftprintf.a
|
||||||
|
LIBFT= $(BUILD_DIR)/libft.a
|
||||||
|
BONUS= $(BUILD_DIR)/libftprintf_bonus.a
|
||||||
|
|
||||||
SRC_DIR= src
|
SRC_DIR= src
|
||||||
|
B_SRC_DIR= bonus
|
||||||
INC_DIR= include
|
INC_DIR= include
|
||||||
LIBFT_DIR= libft
|
LIBFT_DIR= libft
|
||||||
BUILD_DIR= .build
|
BUILD_DIR= .build
|
||||||
@@ -14,8 +17,20 @@ SRC= $(SRC_DIR)/ft_printf.c \
|
|||||||
$(SRC_DIR)/print_str.c \
|
$(SRC_DIR)/print_str.c \
|
||||||
$(SRC_DIR)/print_unsigned.c \
|
$(SRC_DIR)/print_unsigned.c \
|
||||||
|
|
||||||
|
B_SRC= $(B_SRC_DIR)/ft_printf_bonus.c \
|
||||||
|
$(B_SRC_DIR)/ft_putnbr_base_bonus.c \
|
||||||
|
$(B_SRC_DIR)/print_char_bonus.c \
|
||||||
|
$(B_SRC_DIR)/print_hex_bonus.c \
|
||||||
|
$(B_SRC_DIR)/print_number_bonus.c \
|
||||||
|
$(B_SRC_DIR)/print_pointer_bonus.c \
|
||||||
|
$(B_SRC_DIR)/print_str_bonus.c \
|
||||||
|
$(B_SRC_DIR)/print_unsigned_bonus.c \
|
||||||
|
|
||||||
|
|
||||||
OBJ= $(SRC:%.c=$(BUILD_DIR)/%.o)
|
OBJ= $(SRC:%.c=$(BUILD_DIR)/%.o)
|
||||||
|
B_OBJ= $(B_SRC:%.c=$(BUILD_DIR)/%.o)
|
||||||
DEP= $(SRC:%.c=$(BUILD_DIR)/%.d)
|
DEP= $(SRC:%.c=$(BUILD_DIR)/%.d)
|
||||||
|
B_DEP= $(B_SRC:%.c=$(BUILD_DIR)/%.d)
|
||||||
|
|
||||||
CC= cc
|
CC= cc
|
||||||
CFLAGS= -Wall -Wextra -Werror -I$(INC_DIR) -I$(LIBFT_DIR) -MMD -MP
|
CFLAGS= -Wall -Wextra -Werror -I$(INC_DIR) -I$(LIBFT_DIR) -MMD -MP
|
||||||
@@ -23,25 +38,35 @@ AR= ar rcs
|
|||||||
|
|
||||||
all: $(NAME)
|
all: $(NAME)
|
||||||
|
|
||||||
$(NAME): $(OBJ)
|
bonus: $(BONUS)
|
||||||
$(MAKE) -C $(LIBFT_DIR)
|
cp $(BONUS) $(NAME)
|
||||||
cp $(LIBFT_DIR)/libft.a $(NAME)
|
|
||||||
|
$(NAME): $(OBJ) $(LIBFT)
|
||||||
|
cp $(LIBFT) $(NAME)
|
||||||
$(AR) $(NAME) $(OBJ)
|
$(AR) $(NAME) $(OBJ)
|
||||||
|
|
||||||
$(BUILD_DIR)/%.o: %.c
|
$(BUILD_DIR)/%.o: %.c
|
||||||
@mkdir -p $(dir $@)
|
mkdir -p $(dir $@)
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
$(LIBFT):
|
||||||
|
$(MAKE) -C $(LIBFT_DIR)
|
||||||
|
cp $(LIBFT_DIR)/libft.a $(LIBFT)
|
||||||
|
|
||||||
|
$(BONUS): $(B_OBJ) $(LIBFT)
|
||||||
|
cp $(LIBFT) $(BONUS)
|
||||||
|
$(AR) $(BONUS) $(B_OBJ)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJ) $(DEP)
|
rm -f $(OBJ) $(DEP) $(B_OBJ) $(B_DEP)
|
||||||
$(MAKE) -C $(LIBFT_DIR) clean
|
$(MAKE) -C $(LIBFT_DIR) clean
|
||||||
|
|
||||||
fclean: clean
|
fclean: clean
|
||||||
rm -f $(NAME)
|
rm -f $(NAME) $(BONUS) $(LIBFT)
|
||||||
$(MAKE) -C $(LIBFT_DIR) fclean
|
$(MAKE) -C $(LIBFT_DIR) fclean
|
||||||
|
|
||||||
re: fclean all
|
re: fclean all
|
||||||
|
|
||||||
-include $(DEP)
|
-include $(DEP) $(B_DEP)
|
||||||
|
|
||||||
.PHONY: all clean fclean re
|
.PHONY: all clean fclean re bonus
|
||||||
|
|||||||
59
bonus/ft_printf_bonus.c
Normal file
59
bonus/ft_printf_bonus.c
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_printf_bonus.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 10:54:03 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/19 13:35:28 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include "ft_printf_bonus.h"
|
||||||
|
|
||||||
|
static int ft_print_arg(char c, va_list args)
|
||||||
|
{
|
||||||
|
if (c == 'c')
|
||||||
|
return (print_char(va_arg(args, int)));
|
||||||
|
else if (c == 's')
|
||||||
|
return (print_str(va_arg(args, char *)));
|
||||||
|
else if (c == 'p')
|
||||||
|
return (print_pointer(va_arg(args, unsigned long long)));
|
||||||
|
else if (c == 'd' || c == 'i')
|
||||||
|
return (print_number(va_arg(args, int)));
|
||||||
|
else if (c == 'u')
|
||||||
|
return (print_unsigned(va_arg(args, unsigned int)));
|
||||||
|
else if (c == 'x')
|
||||||
|
return (print_hex(va_arg(args, unsigned int), 0));
|
||||||
|
else if (c == 'X')
|
||||||
|
return (print_hex(va_arg(args, unsigned int), 1));
|
||||||
|
else if (c == '%')
|
||||||
|
return (print_char('%'));
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ft_printf(const char *first_arg, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
int nb_print;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
nb_print = 0;
|
||||||
|
va_start(args, first_arg);
|
||||||
|
i = 0;
|
||||||
|
while (first_arg[i])
|
||||||
|
{
|
||||||
|
if (first_arg[i] == '%')
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
nb_print += ft_print_arg(first_arg[i], args);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
nb_print += write(1, &first_arg[i], 1);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return (nb_print);
|
||||||
|
}
|
||||||
24
bonus/ft_putnbr_base_bonus.c
Normal file
24
bonus/ft_putnbr_base_bonus.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_putnbr_base.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 12:16:44 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/17 12:43:17 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "libft.h"
|
||||||
|
|
||||||
|
int ft_putnbr_base(unsigned long long nbr, char *base, int base_size)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (nbr == 0)
|
||||||
|
return (0);
|
||||||
|
i = 1 + ft_putnbr_base(nbr / base_size, base, base_size);
|
||||||
|
ft_putchar_fd(base[nbr % base_size], 1);
|
||||||
|
return (i);
|
||||||
|
}
|
||||||
18
bonus/print_char_bonus.c
Normal file
18
bonus/print_char_bonus.c
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* print_char.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 11:56:36 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/17 12:45:57 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int print_char(char c)
|
||||||
|
{
|
||||||
|
return (write(1, &c, 1));
|
||||||
|
}
|
||||||
24
bonus/print_hex_bonus.c
Normal file
24
bonus/print_hex_bonus.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* print_hex_bonus.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 12:06:35 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/19 13:35:40 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "ft_printf_bonus.h"
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int print_hex(unsigned long long nbr, int upper)
|
||||||
|
{
|
||||||
|
if (nbr == 0)
|
||||||
|
return (write(1, "0", 1));
|
||||||
|
if (upper)
|
||||||
|
return (ft_putnbr_base(nbr, "0123456789ABCDEF", 16));
|
||||||
|
else
|
||||||
|
return (ft_putnbr_base(nbr, "0123456789abcdef", 16));
|
||||||
|
}
|
||||||
29
bonus/print_number_bonus.c
Normal file
29
bonus/print_number_bonus.c
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* print_number_bonus.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 12:26:23 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/19 13:35:48 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "ft_printf_bonus.h"
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int print_number(int nbr)
|
||||||
|
{
|
||||||
|
unsigned int p_nbr;
|
||||||
|
|
||||||
|
if (nbr == 0)
|
||||||
|
return (write(1, "0", 1));
|
||||||
|
if (nbr < 0)
|
||||||
|
{
|
||||||
|
write(1, "-", 1);
|
||||||
|
p_nbr = nbr * -1;
|
||||||
|
return (1 + ft_putnbr_base(p_nbr, "0123456789", 10));
|
||||||
|
}
|
||||||
|
return (ft_putnbr_base(nbr, "0123456789", 10));
|
||||||
|
}
|
||||||
25
bonus/print_pointer_bonus.c
Normal file
25
bonus/print_pointer_bonus.c
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* print_pointer_bonus.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 12:19:16 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/19 13:35:58 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "libft.h"
|
||||||
|
#include "ft_printf_bonus.h"
|
||||||
|
|
||||||
|
int print_pointer(unsigned long long p)
|
||||||
|
{
|
||||||
|
if (!p)
|
||||||
|
{
|
||||||
|
ft_putstr_fd("(nil)", 1);
|
||||||
|
return (5);
|
||||||
|
}
|
||||||
|
ft_putstr_fd("0x", 1);
|
||||||
|
return (2 + ft_putnbr_base(p, "0123456789abcdef", 16));
|
||||||
|
}
|
||||||
24
bonus/print_str_bonus.c
Normal file
24
bonus/print_str_bonus.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* print_str.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 12:02:03 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/17 12:51:56 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "libft.h"
|
||||||
|
|
||||||
|
int print_str(char *str)
|
||||||
|
{
|
||||||
|
if (!str)
|
||||||
|
{
|
||||||
|
ft_putstr_fd("(null)", 1);
|
||||||
|
return (6);
|
||||||
|
}
|
||||||
|
ft_putstr_fd(str, 1);
|
||||||
|
return (ft_strlen(str));
|
||||||
|
}
|
||||||
21
bonus/print_unsigned_bonus.c
Normal file
21
bonus/print_unsigned_bonus.c
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* print_unsigned_bonus.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 12:26:23 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/19 13:36:08 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "ft_printf_bonus.h"
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int print_unsigned(unsigned int nbr)
|
||||||
|
{
|
||||||
|
if (nbr == 0)
|
||||||
|
return (write(1, "0", 1));
|
||||||
|
return (ft_putnbr_base(nbr, "0123456789", 10));
|
||||||
|
}
|
||||||
38
include/ft_printf_bonus.h
Normal file
38
include/ft_printf_bonus.h
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_printf_bonus.h :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2025/11/17 10:52:23 by dgaillet #+# #+# */
|
||||||
|
/* Updated: 2025/11/19 13:30:52 by dgaillet ### ########lyon.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#ifndef FT_PRINTF_BONUS_H
|
||||||
|
# define FT_PRINTF_BONUS_H
|
||||||
|
|
||||||
|
typedef struct s_arg
|
||||||
|
{
|
||||||
|
char arg;
|
||||||
|
int minus;
|
||||||
|
int zero;
|
||||||
|
int dot;
|
||||||
|
int hash;
|
||||||
|
int space;
|
||||||
|
int plus;
|
||||||
|
} t_arg;
|
||||||
|
|
||||||
|
int ft_printf(const char *first_arg, ...);
|
||||||
|
|
||||||
|
int ft_putnbr_base(unsigned long long nbr, char *base, int base_size);
|
||||||
|
|
||||||
|
int print_char(char c);
|
||||||
|
int print_str(char *str);
|
||||||
|
int print_pointer(unsigned long long p);
|
||||||
|
int print_number(int nbr);
|
||||||
|
int print_unsigned(unsigned int nbr);
|
||||||
|
int print_hex(unsigned long long p, int upper);
|
||||||
|
|
||||||
|
#endif
|
||||||
114
test.c
114
test.c
@@ -1,114 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include "include/ft_printf.h"
|
|
||||||
|
|
||||||
void test(const char *name, int (*test_func)(void))
|
|
||||||
{
|
|
||||||
printf("\n===== %s =====\n", name);
|
|
||||||
test_func();
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_char(void)
|
|
||||||
{
|
|
||||||
int r1, r2;
|
|
||||||
|
|
||||||
r1 = printf("printf: [%c]\n", 'A');
|
|
||||||
r2 = ft_printf("ft_printf: [%c]\n", 'A');
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_string(void)
|
|
||||||
{
|
|
||||||
int r1, r2;
|
|
||||||
|
|
||||||
r1 = printf("printf: [%s]\n", "Hello");
|
|
||||||
r2 = ft_printf("ft_printf: [%s]\n", "Hello");
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
r1 = printf("printf: [%s]\n", NULL);
|
|
||||||
r2 = ft_printf("ft_printf: [%s]\n", NULL);
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_pointer(void)
|
|
||||||
{
|
|
||||||
int x = 42;
|
|
||||||
int r1, r2;
|
|
||||||
|
|
||||||
r1 = printf("printf: [%p]\n", &x);
|
|
||||||
r2 = ft_printf("ft_printf: [%p]\n", &x);
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
r1 = printf("printf: [%p]\n", NULL);
|
|
||||||
r2 = ft_printf("ft_printf: [%p]\n", NULL);
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_decimal(void)
|
|
||||||
{
|
|
||||||
int r1, r2;
|
|
||||||
|
|
||||||
r1 = printf("printf: [%d] [%i]\n", 42, -42);
|
|
||||||
r2 = ft_printf("ft_printf: [%d] [%i]\n", 42, -42);
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
r1 = printf("printf: [%d]\n", INT_MIN);
|
|
||||||
r2 = ft_printf("ft_printf: [%d]\n", INT_MIN);
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_unsigned(void)
|
|
||||||
{
|
|
||||||
int r1, r2;
|
|
||||||
|
|
||||||
r1 = printf("printf: [%u]\n", 4294967295u);
|
|
||||||
r2 = ft_printf("ft_printf: [%u]\n", 4294967295u);
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_hex(void)
|
|
||||||
{
|
|
||||||
int r1, r2;
|
|
||||||
|
|
||||||
r1 = printf("printf: [%x] [%X]\n", 3735928559u, 3735928559u);
|
|
||||||
r2 = ft_printf("ft_printf: [%x] [%X]\n", 3735928559u, 3735928559u);
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_percent(void)
|
|
||||||
{
|
|
||||||
int r1, r2;
|
|
||||||
|
|
||||||
r1 = printf("printf: [%%]\n");
|
|
||||||
r2 = ft_printf("ft_printf: [%%]\n");
|
|
||||||
printf("Return printf: %d | Return ft_printf: %d\n", r1, r2);
|
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
test("CHAR", test_char);
|
|
||||||
test("STRING", test_string);
|
|
||||||
test("POINTER", test_pointer);
|
|
||||||
test("DECIMAL", test_decimal);
|
|
||||||
test("UNSIGNED", test_unsigned);
|
|
||||||
test("HEX", test_hex);
|
|
||||||
test("PERCENT", test_percent);
|
|
||||||
|
|
||||||
printf("\n===== ALL TESTS DONE =====\n");
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user