-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_tolower.c
29 lines (26 loc) · 1.28 KB
/
ft_tolower.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_tolower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dolvin17 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/21 21:28:15 by ghuertas #+# #+# */
/* Updated: 2022/04/25 11:21:05 by dolvin17 ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/* convierte mayúsculas a minúsculas */
int ft_tolower(int c)//el char a modificar.
{
if (c >= 'A' && c <= 'Z')//si c es alfabeticamente mayuscula
return (c + 32);//sumo 32 en ascci para llegar a su equivalente en minuscula.
return (c);//si c ya era mayuscua, la retorno sin modificacion alguna.
}
/*
int main(void)
{
printf("%d\n", ft_tolower('B'));
printf("%d\n", tolower('B'));
}
*/