-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_toupper.c
46 lines (39 loc) · 1.56 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
36
37
38
39
40
41
42
43
44
45
46
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_toupper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sperez-p <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 12:46:01 by sperez-p #+# #+# */
/* Updated: 2021/08/20 12:46:04 by sperez-p ### ########.fr */
/* */
/* ************************************************************************** */
/*
NAME
****
ft_toupper ---> convert char to uppercase
SYNOPSIS
********
#include "libft.h"
int ft_toupper(int c);
PARAMETERS
**********
c --> The character to convert.
DESCRIPTION
***********
The ft_toupper() function uses the ft_islower() function to check if 'c'
is alphabetic and lowercase. If it is the case, converts it to uppercase and
if it not, it does not modify it.
RETURN VALUE
************
- The character converted to uppercase.
- If it is not possible to convert, the original character.
*/
#include "libft.h"
int ft_toupper(int c)
{
if (c >= 97 && c <= 122)
return (c - 32);
return (c);
}