-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_toupper.c
29 lines (27 loc) · 1.4 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: mmaurer <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/24 15:57:38 by mmaurer #+# #+# */
/* Updated: 2021/09/01 23:26:20 by mmaurer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
* If c is a lowercase letter, toupper() returns its uppercase equivalent, if an
* uppercase representation exists in the current locale. Otherwise, it returns
* c. If c is a lowercase it works the other was around.
* If c is neither an unsigned char value nor EOF, the behavior of this
* function is undefined.
* RETURN VALUE: The value returned is that of the converted letter, or c if the
* conversion was not possible.
*/
int ft_toupper(int c)
{
if ('a' <= c && c <= 'z')
return (c - CASE_CONVERT);
return (c);
}