Hi I was wondering if someone could please help me understand why every time I try to run this code it runs but will abort as soon as it gets to it. It only does it when I have i inside the PassWord.at(i). When I replace it with an int such as 0 or 1 it works correctly but only checks that character. I need to be able to check the entire string to see if it has a lowercase character. Thanks!
int check = 0;
for(int i = 0; i <= PassWord.size(); i++)
{
if(islower(PassWord.at(i)) != 0)
{
check++;
}
}
Your loop control should be
The way you had it, you would index outside the array. You can only index from 0 to size-1.