๐toupper
โ๏ธ ํจ์ ํ๋กํ ํ์
int ft_toupper(int c);
โ๏ธ ํจ์์ ์ญํ : c๊ฐ ์๋ฌธ์ ์ํ๋ฒณ์ผ ๊ฒฝ์ฐ ๋๋ฌธ์๋ก ๋ณ๊ฒฝ
โ๏ธํจ์ ๋ฐํ๊ฐ
โ๏ธ ๋ณ๊ฒฝ๋ c (๋ณ๊ฒฝ๋์ง ์์์ ๊ฒฝ์ฐ ๊ทธ๋๋ก c๋ฅผ ๋ฆฌํด)
โ๏ธ ๊ตฌํ
int ft_toupper(int c)
{
if ('a' <= c && c <= 'z')
c = c + ('A' - 'a');
return (c);
}
๐tolower
โ๏ธ ํจ์ ํ๋กํ ํ์
int ft_tolower(int c);
โ๏ธ ํจ์์ ์ญํ : c๊ฐ ๋๋ฌธ์ ์ํ๋ฒณ์ผ ๊ฒฝ์ฐ, ์๋ฌธ์๋ก ๋ณ๊ฒฝ
โ๏ธํจ์ ๋ฐํ๊ฐ
โ๏ธ ๋ณ๊ฒฝ๋ c (๋ณ๊ฒฝ๋์ง ์์์ ๊ฒฝ์ฐ ๊ทธ๋๋ก c๋ฅผ ๋ฆฌํด)
โ๏ธ ๊ตฌํ
int ft_tolower(int c)
{
if ('A' <= c && c <= 'Z')
c = c + 'a' - 'A';
return (c);
}
'๐ฐ42์์ธ > libft' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[42์์ธ] libft ์ ๋ฆฌ : ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ง๋ค๊ธฐ ์ํ Makefile (0) | 2022.02.11 |
---|---|
[42์์ธ] libft ์ ๋ฆฌ : ft_strlen, ft_strlcpy, ft_strlcat ๊ตฌํ (0) | 2022.02.07 |
[42์์ธ] libft ์ ๋ฆฌ : ft_isalpha, ft_isdigit, ft_isalnum, ft_isascii, ft_isprint ๊ตฌํ (0) | 2022.01.13 |
[42์์ธ] libft ์ ๋ฆฌ: strdup (0) | 2022.01.05 |
[42์์ธ] libft ์ ๋ฆฌ: calloc (0) | 2022.01.04 |