This is a part of my code (a boolean function) ,so the goal is to return true or false. It's working pretty well, but I was wandering if there were a better way. Instead of using those integers, is there a shorter way? thanks....
int l = strlen(password);
int b, c, d, e;
for (int i = 0; i < l; i++)
{
if (isupper(password[i]))
{
b = 1;
}
else if (islower(password[i]))
{
c = 1;
}
else if (isdigit(password[i]))
{
d = 1;
}
else if (isgraph(password[i]))
{
e = 1;
}
int a = b + c + d + e;
if (a == 4)
{
return true;
}
else
{
return false;
}