isalnum
Testet, ob ein Element in einem Gebietsschema ein alphabetisches oder ein numerisches Zeichen ist.
template<Class CharType>
bool isalnum(
CharType _Ch,
const locale& _Loc
)
Parameter
_Ch
Das alphanumerische zu testenden Element._Loc
Das Gebietsschema, das das alphanumerische zu testenden Element enthält.
Rückgabewert
true, wenn das Element, das getestet wird, alphanumerisch ist; false, wenn nicht ist.
Beispiel
// locale_isalnum.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;
int main( )
{
locale loc ( "German_Germany" );
bool result1 = isalnum ( 'L', loc);
bool result2 = isalnum ( '@', loc);
bool result3 = isalnum ( '3', loc);
if ( result1 )
cout << "The character 'L' in the locale is "
<< "alphanumeric." << endl;
else
cout << "The character 'L' in the locale is "
<< " not alphanumeric." << endl;
if ( result2 )
cout << "The character '@' in the locale is "
<< "alphanumeric." << endl;
else
cout << "The character '@' in the locale is "
<< " not alphanumeric." << endl;
if ( result3 )
cout << "The character '3' in the locale is "
<< "alphanumeric." << endl;
else
cout << "The character '3' in the locale is "
<< " not alphanumeric." << endl;
}
Anforderungen
Header: <locale>
Namespace: std