I need help creating 3 functions. In the program the user enters a password but it must meet specific details. When I try these methods they fail how can I edit them to work. Should I use a different C String function?
//Check for special character
int sc;
char scset[] = "!$%";
sc = strcspn (passwd, scset);
if (sc == 0) {
cout << "No numeric character found." << endl;
}
returnfalse;
// Check that the password does not begin with ? or !
if (passwd[0]=='?' || passwd[0]=='!') {
cout << "Password must not being with ! or ?." << endl;
}
returnfalse;
// Check that the first 3 characters are not equivalent
if (passwd[0] == passwd[1] == passwd[2]) {
cout << "First three characters must not be the same." << endl;
}
returnfalse;
//Check for special character
int sc;
char scset[] = "!$%";
sc = strcspn (passwd, scset);
if (sc == 0) {
cout << "No numeric character found." << endl;
returnfalse;
}
// Check that the password does not begin with ? or !
if (passwd[0]=='?' || passwd[0]=='!') {
cout << "Password must not being with ! or ?." << endl;
returnfalse;
}
// Check that the first 3 characters are not equivalent
if (passwd[0] == passwd[1] == passwd[2]) {
cout << "First three characters must not be the same." << endl;
returnfalse;
}