std::isalpha
Header: <cctype>
Checks if the given character is an alphabetic character as classified by the currently installed C locale. In the default locale, the following characters are alphabetic:
# Declarations
int isalpha( int ch );
# Parameters
ch: character to classify
# Return value
Non-zero value if the character is an alphabetic character, zero otherwise.
# Notes
Like all other functions from
Similarly, they should not be directly used with standard algorithms when the iterator’s value type is char or signed char. Instead, convert the value to unsigned char first:
# Example
#include <cctype>
#include <clocale>
#include <iostream>
int main()
{
unsigned char c = '\xdf'; // German letter ß in ISO-8859-1
std::cout << "isalpha(\'\\xdf\', default C locale) returned "
<< std::boolalpha << !!std::isalpha(c) << '\n';
std::setlocale(LC_ALL, "de_DE.iso88591");
std::cout << "isalpha(\'\\xdf\', ISO-8859-1 locale) returned "
<< static_cast<bool>(std::isalpha(c)) << '\n';
}