종류
- isalpha : 대문자, 소문자 판별
- isascii : 아스키 코드 내에 들어가는지 판별
- isdigit : 아스키 코드 상으로 0 ~ 9 사이에 들어가는지 판별
- isprint : 프린트 가능한지 판별
- isalnum : 문자 또는 숫자 인지 판별
구현
c
int ft_isalpha(int c)
{
if (c >= 65 && c <= 90)
return (1);
else if (c >= 97 && c <= 122)
return (1);
else
return (0);
}
c
int ft_isalnum(int c)
{
if (c >= 65 && c <= 90)
return (1);
else if (c >= 97 && c <= 122)
return (1);
else if (c >= '0' && c <= '9')
return (1);
else
return (0);
}
c
int ft_isascii(int c)
{
if (c >= 0 && c <= 127)
return (1);
else
return (0);
}
c
int ft_isdigit(int c)
{
if (c >= '0' && c <= '9')
return (1);
else
return (0);
}
c
int ft_isprint(int c)
{
if (c >= 32 && c <= 126)
return (1);
else
return (0);
}