-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_toupper.c
32 lines (28 loc) · 1.16 KB
/
ft_toupper.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_toupper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aldokezer <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/18 12:37:08 by orezek #+# #+# */
/* Updated: 2023/10/29 16:59:37 by aldokezer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
static int ft_islower(int c)
{
unsigned char letter;
if (c == EOF)
return (0);
letter = (unsigned char) c;
if (letter >= 'a' && letter <= 'z')
return (1);
return (0);
}
int ft_toupper(int c)
{
if (ft_isalpha(c) && ft_islower(c))
return (c - 32);
return (c);
}