ft_strupcase.c

This commit is contained in:
Timo Schmidt 2023-03-19 11:25:30 +01:00
parent e6dc426c58
commit cd2f992fbd
1 changed files with 35 additions and 0 deletions

35
ex07/ft_strupcase.c Normal file
View File

@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strupcase.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 11:18:13 by tischmid #+# #+# */
/* Updated: 2023/03/19 11:23:14 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strupcase(char *str)
{
int i;
i = -1;
while (str[++i] != '\0')
if (str[i] >= 'a' && str[i] <= 'z')
str[i] = str[i] & 95;
return (str);
}
#define START
#include <stdio.h>
int main(void)
{
char s1[] = "hello world";
char *s2;
printf("%s\n", s1);
s2 = ft_strupcase(s1);
printf("%s\n", s2);
return (0);
}