When I put breakpoints to watch it, it skips right over the line where it should read getline(cin, sentence). why is it doing this and how can I fix it? It goes straight to the line that reads "PASSWORD IS INVALID".
string setlevel2()
{
string sentence;
bool one = false, two = false;
cout << "Second level of security program" << endl;
cout << "Enter a sentence you would like to use ";
cout << "(it must contain more than one word and end in a '.')" << endl;
cin.clear();
//cin >> sentence;
getline(cin, sentence);
for (unsignedint x = 0; x <= sentence.length(); x++)
{
if (sentence[x] == ' ')
{
one = true;
}
elseif (sentence[x] == '.')
{
two = true;
}
}
if (one == true && two == true)
{
cout << "PASSWORD IS VALID" << endl;
return sentence;
}
else
{
cout << "PASSWORD IS INVALID" << endl;
system("pause");
exit(0);
}
}