089. 문자가 알파벳인지 검사하기(isalpha)089. 문자가 알파벳인지 검사하기(isalpha)
Posted at 2011. 2. 12. 01:10 | Posted in Computer/초보자를 위한 C 언어 300제
#include <stdio.h>
#include <ctype.h>
void main( void )
{
char *string = "Cat 1 Car 2 Cow 3,...";
char buffer[100] = {0,};
int cnt = 0;
while( *string )
{
if(isalpha( *string ))
{
buffer[cnt++] = *string;
}
string++;
}
puts( buffer );
}
'Computer > 초보자를 위한 C 언어 300제' 카테고리의 다른 글
| 088. 실수를 문자열로 변환하기 3(gcvt) (0) | 2011.02.12 |
|---|---|
| 087. 실수를 문자열로 변환하기 2(ecvt) (0) | 2011.02.12 |
| 086. 실수를 문자열로 변환하기 1(fcvt) (0) | 2011.02.12 |
| 085. 정수를 문자열로 변환하기 3(ultoa) (0) | 2011.02.12 |
| 084. 정수를 문자열로 변환하기 2(ltoa) (0) | 2011.02.12 |
