Hello I am trying to create a password func with c++ that handles up to 12 characters and that can call three separate bool functions: isUpper, isLower, IsPunctuation.
Any suggestions or templates to start with? I'd like to get this part out of the way and go on with my program. Thank you for all your help.
This is what I have so far:
#include<iostream.h>
#include<conio.h>
#include<string.h>
char enterPass();
void passFunc();
char enterPass() {
char numPass[12];
char ch;
int i=0;
while((ch!='\r')||(ch!='\n')&&(i!=11)) {
cin>>ch; cout<<'*'; numPass[i]=ch; i++;
}
return numPass[12];
}
void passFunc() {
char pass[12];
cout<<"Enter password :- ";
pass=enterPass();
if(strcmp(pass,"myworld")==0) {
cout<<"Correct Password"; getch();
} else {
cout<<"Wrong Password";
exit(0);
}
}
int main() {
passFunc();
getch();
return 0;
}