This documentation is copyright © 1998-2001 Sandro Sigala <sandro@sigala.it>.
All rights reserved.
Released under the GNU General Public License.
isalpha
Prototype
#include <ctype.h>
int isalpha(int c);
Description
In the ``C'' locale, returns a true value for the characters for which
isupper
or islower
is true. In other implementation-defined set
of characters returns true for the characters for which none of
iscntrl
, isdigit
, ispunct
, or isspace
is true.
Example
#include <ctype.h>
#include <stdio.h>
/*
* Return the next word read the standard input.
*/
char *get_word(char *buf)
{
char *dp = buf;
int c;
while (isalpha(c = getchar()))
*dp++ = c;
if (c != EOF)
ungetc(c, stdin);
*dp = '\0';
return buf;
}
References
ISO C 9899:1990 7.3.1.2