From b4d1a32d65645e8e8a96c77bf5579ddef56a747e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Sun, 5 Oct 2025 22:00:14 +0200 Subject: [PATCH] feat: add ft_toupper function --- ft_toupper.c | 8 ++++++++ libft.h | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 ft_toupper.c diff --git a/ft_toupper.c b/ft_toupper.c new file mode 100644 index 0000000..2028de4 --- /dev/null +++ b/ft_toupper.c @@ -0,0 +1,8 @@ +#include "libft.h" + +int ft_toupper(int c) +{ + if ('a' <= c && c <= 'z') + c -= 32; + return (c); +} diff --git a/libft.h b/libft.h index 18c86f4..2260ad5 100644 --- a/libft.h +++ b/libft.h @@ -88,4 +88,13 @@ void *ft_memmove(void *dst, const void *src, size_t n); */ size_t ft_strlcpy(char *dst, const char *src, size_t dstsize); +// size_t ft_strlcat(char *dst, const char *src, size_t dstsize); + +/* + The toupper() function converts a + lower-case letter to the + corresponding upper-case letter. +*/ +int ft_toupper(int c); + #endif