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

< C++ Programming < Code < Standard C Library < Functions

isalnum

Syntax
#include <cctype>
int isalnum( int ch );

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

char c;
scanf( "%c", &c );
if( isalnum(c) )
  printf( "You entered the alphanumeric character %c\n", c );
Related topics
isalpha - iscntrl - isdigit - isgraph - isprint - ispunct - isspace - isxdigit
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.