|
C++ / Sources
/ Fonctions pour la gestion des caractères
Echanger deux caractères
char echange (char & cPremier, char & cSecond)
{
char cEchange;
cEchange = cPremier;
cPremier = cSecond;
cSecond = cEchange;
}
Vérifier si un caractère est une minuscule
int islower (char cCar)
{
if ( (cCar >= 'a') &&
(cCar <= 'z')) return 1;
return 0;
}
Vérifier si un caractère est une majuscule
int isupper (char cCar)
{
if ( (cCar >= 'A') &&
(cCar <= 'Z')) return 1;
return 0;
}
Vérifier si un caractère est un chiffre
int isdigit (char cCar)
{
if ( (cCar >= '0') &&
(cCar <= '9')) return 1;
return 0;
}
|