你好,我正在嘗試創建一個密碼功能與c + +處理多達12個字符,並可以調用三個單獨的bool函數:isUpper,isLower,IsPunctuation。編程密碼功能模板
任何建議或模板開頭?我想把這部分弄清楚,繼續我的程序。謝謝你的幫助。
這是我到目前爲止有:
#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;
}
沒有這是不是從學校我26歲,我試過使用[code]標籤但沒有工作,就像我說的我試圖做一個密碼功能的程序即時編碼將有半敏感信息,爲什麼我的帖子在負面2代表,並沒有什麼,但沒有建設性的意見是這不是一個編碼論壇? – user1350623 2012-04-23 17:30:07