ft_tolower: initial implementation

This commit is contained in:
Khaïs COLIN 2024-10-16 10:32:29 +02:00
parent 21e04cc22c
commit 1eb276c8cf
3 changed files with 40 additions and 2 deletions

View file

@ -6,7 +6,7 @@
# By: kcolin <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/10/14 13:43:59 by kcolin #+# #+# #
# Updated: 2024/10/16 09:58:22 by kcolin ### ########.fr #
# Updated: 2024/10/16 10:30:28 by kcolin ### ########.fr #
# #
# **************************************************************************** #
@ -24,7 +24,8 @@ SOURCES = ft_isalpha.c \
ft_memmove.c \
ft_strlcpy.c \
ft_strlcat.c \
ft_toupper.c
ft_toupper.c \
ft_tolower.c
OBJECTS = $(SOURCES:.c=.o)
CC = gcc

36
ft_tolower.c Normal file
View file

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_tolower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/16 10:30:41 by kcolin #+# #+# */
/* Updated: 2024/10/16 10:31:43 by kcolin ### ########.fr */
/* */
/* ************************************************************************** */
int ft_tolower(int c)
{
if (c >= 'A' && c <= 'Z')
c += 0x20;
return (c);
}
/*
#include <stdio.h>
#include <ctype.h>
int main(void)
{
int i;
i = 0;
while (i < 256)
{
printf("%d\t%c\t%c\t%c\n", i, i, ft_tolower(i), tolower(i));
i++;
}
return (0);
}
*/

View file

@ -31,5 +31,6 @@ t_size ft_strlcpy(char *dst, const char *src, t_size size);
t_size ft_strlcat(char *dst, const char *src, t_size size);
int ft_toupper(int c);
int ft_tolower(int c);
#endif