I have tried just about everything I can think of, I keep getting runtime errors.
I am checking for alphabet first with "isalpha" before I add "isupper" & "islower" to my code.
//Validate if password contains a digit
for (int i = 0; i < SIZE - 1; i++)
{
if (isdigit(password[i]))
{
digit = true;
}
}
//Validate if password contains letters
for (int count = 0; count < SIZE - 1; count++)
{
if (isalpha(password[count]))
{
letter = true;
}
}
cout << "The password is invalid:\n";
if (length == false)
{
cout << "Your Password is not at least 6 characters long.\n";
}
if (digit == false)
{
cout << "Your Password does not contain at least one digit.\n";
}
if (letter == false)
{
cout << "Your Password does not contain at least one lowercase\n"
<< " & one uppercase letter.\n";
}
This is the runtime error I've been getting.
I can't use multiple functions, just the one.
It is part of an assignment from school.
I just cant figure out what im doing wrong with 'isalpha' & 'isdigit'