回复 2楼 rjsp
不知道咋用,我只是想做个密码输入类
class Key
{
public:
int cmp()
{
cout<<setw(30)<<"请输入密码:"<<endl;
while((ch=_getch())!='\r')
{
if(ch=='\b')
{
cout<<"\b \b";
password.pop_back();
continue;
}
password.push_back(ch);
cout<<"*";
}
if(password==pass)
return 1;
else
return 0;
}
private:
char ch;
vector<char> password;
vector<char> pass="eb36520";
};