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 );
}
//