Jump to content

C++ Programming/Code/Standard C Library/Functions/isalpha

From Wikibooks, open books for an open world

isalpha

[edit | edit source]
Syntax
#include <cctype>
int isalpha( int ch );

The function isalpha() returns non-zero if its argument is a letter of the alphabet. Otherwise, zero is returned.

char c;
scanf( "%c", &c );
if( isalpha(c) )
  printf( "You entered a letter of the alphabet\n" );
Related topics
isalnum - iscntrl - isdigit - isgraph - isprint - ispunct - isspace - isxdigit