ft_toupper: initial implementation

This commit is contained in:
Khaïs COLIN 2024-10-16 10:28:00 +02:00
parent 870ce44765
commit 21e04cc22c
3 changed files with 42 additions and 3 deletions

36
ft_toupper.c Normal file
View file

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_toupper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/16 09:58:42 by kcolin #+# #+# */
/* Updated: 2024/10/16 10:25:57 by kcolin ### ########.fr */
/* */
/* ************************************************************************** */
int ft_toupper(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_toupper(i), toupper(i));
i++;
}
return (0);
}
*/