From dad84d85dbfd229db3d5f3b2401e1b94a71a934e Mon Sep 17 00:00:00 2001 From: Tanguy MAZE Date: Wed, 4 Apr 2018 14:23:48 +0200 Subject: [PATCH] ft_toupper --- Makefile | 5 +++-- ft_toupper.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 ft_toupper.c diff --git a/Makefile b/Makefile index 0eed71e..56a5d47 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: tmaze +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2018/04/04 10:51:59 by tmaze #+# #+# # -# Updated: 2018/04/04 12:32:19 by tmaze ### ########.fr # +# Updated: 2018/04/04 14:09:35 by tmaze ### ########.fr # # # #******************************************************************************# @@ -20,7 +20,8 @@ SRCS = ft_isalpha.c \ ft_isdigit.c \ ft_isalnum.c \ ft_isascii.c \ - ft_isprint.c + ft_isprint.c \ + ft_toupper.c OBJS = $(SRCS:.c=.o) INCLS = -I. diff --git a/ft_toupper.c b/ft_toupper.c new file mode 100644 index 0000000..f0d4494 --- /dev/null +++ b/ft_toupper.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_toupper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: tmaze +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2018/04/04 14:06:21 by tmaze #+# #+# */ +/* Updated: 2018/04/04 14:20:19 by tmaze ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_toupper(int c) +{ + return ((c >= 'a' && c <= 'z') ? c - 32 : c); +}