こんにちは、最大 12 文字を処理し、isUpper、isLower、IsPunctuation の 3 つの個別のブール関数を呼び出すことができる c++ でパスワード関数を作成しようとしています。
開始するための提案やテンプレートはありますか? この部分を邪魔にならないようにして、プログラムを続けたいと思います。いつもお世話になっております。
これは私がこれまでに持っているものです:
#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;
}