forked from bridiefranks/42-libft-with-comments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_toupper.c
35 lines (34 loc) · 1.45 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
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_toupper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bfranks <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/03 18:23:34 by bfranks #+# #+# */
/* Updated: 2022/03/10 12:16:59 by bfranks ### ########.fr */
/* */
/* ************************************************************************** */
/* this function converts any lowercase character (passed as an int) into an upper case character, and
* then returns that character*/
#include "libft.h"
/*#include <stdio.h>*/
int ft_toupper(int c)
{
if (c >= 'a' && c <= 'z')
/* if int c is between the ascii values corresponding to the lowercase a and z...*/
{
c = c - 32;
/* change the value of c to be 32 ascii characters less than the original, which equates to
* the upper case version of the original lowercase letter*/
}
return (c);
}
/*
int main(void)
{
int b;
b = ft_toupper('8');
printf("%d\n", b);
return (0);
}*/