-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_str_toupper.c
32 lines (29 loc) · 1.07 KB
/
ft_str_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_toupper.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wleite <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/25 17:20:04 by wleite #+# #+# */
/* Updated: 2021/08/25 17:20:42 by wleite ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_str_toupper(char *str)
{
int i;
if (!str)
return (-1);
i = 0;
while (*str)
{
if (*str >= 'a' && *str <= 'z')
{
*str -= 32;
i++;
}
str++;
}
return (i);
}