在C++中输入密码变星号,并且按退格键是能删除,还有实现判断正误问题

[复制链接]
查看11 | 回复1 | 2011-5-11 23:11:20 | 显示全部楼层 |阅读模式
判断时用strcmp来实现

回复

使用道具 举报

千问 | 2011-5-11 23:11:20 | 显示全部楼层
#include #include #include using namespace std;int main(){char pw[20];char ch;char pw_saved[]="MyPassWd"; // 正确的口令存放在此int i=0; cout << "Enter pass\n"; ch = _getch(); while( (ch & 0xff) != 13) { if( (ch & 0xff) == 8) { cout << ch << ' ' << ch; i--;}
else{ cout <<
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行