I'm a beginner programmer and a have this problem that I'm unable to solve. My assignment is to create a password checking program, which woud take unlimited amount of passwords from stdin (in a file and read every line as a separate password) and test them on four different levels of security. We can't use string.h, ctype.h, malloc, free...
I'm stuck at the first level, which is "test that password includes both lowercase and uppercase letters. I was able to check if it contains at least one of those, or if it is only comprised of combinations of two, with the code below, but I'm lost beyond that. Please, help.
while (string[i] != '\0')
{
if (isChar_abc(string[i]) == false)
{
if (isChar_ABC(string[i]) == true)
{
i++;
}
else if (isChar_ABC(string[i]) == false)
{
printf("Error, end code\n");
return 0;
}
}
else if (isChar_ABC(string[i]) == false)
{
if (isChar_abc(string[i]) == true)
{
i++;
}
else if (isChar_abc(string[i]) == false)
{
printf("Error, end code\n");
return 0;
}
}
}