How is it possible to see if the last four elements of an array match the last four elements of the second array?
For instance, I'm writing a password program. First, the user is asked their birth date. Then they are asked to input a password.
for the birth date array, the user enters '05/14/1984' for the password array, the user enters 'coke_1984'
I'm trying to see if the last four of birth date are the same as the last four of the password, if all four match, then add 1 to score.
I'm completely stuck! The code I have now has an "invalid conversion from 'char' to 'const char*'"
for(i = len; i <= len; i--)
{
if(strcmp(birthdate, password[i]) == 0)
{
dateCMP = true;
}else{dateCMP = false;}
}
if(dateCMP = true)
{
score += 1;
cout << "Your date of birth should not be the last four characters";
}