-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_toupper.c
29 lines (26 loc) · 1.26 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_toupper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dolvin17 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/21 20:46:35 by ghuertas #+# #+# */
/* Updated: 2022/04/25 11:22:21 by dolvin17 ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/* convierte minúsculas a mayúsculas */
int ft_toupper(int c)
{
if (c >= 'a' && c <= 'z')//si c es alfabeticamente minuscula
return (c - 32);//resto 32 en ascci para llegar a su equivalente en mayuscula.
return (c);//si c ya era minuscula, la retorno sin modificacion alguna.
}
/*
int main(void)
{
printf("%d\n", ft_toupper('k'));
printf("%d\n", toupper('k'));
}
*/