posts - 0, comments - 0, trackbacks - 0, articles - 1

c++ 中实现密码输入隐藏

Posted on 2009-07-14 16:10 小桥流水 阅读(273) 评论(0)  编辑 收藏 引用
 1 #include<iostream>   
 2 #include<conio.h>   
 3 #include <string>   
 4 using namespace std;   
 5 int main()   
 6 {   
 7     char a;   
 8     string str;   
 9     while((a=getch())!=0x0d){   
10         cout<<"*";     
11         str += a;   
12     }   
13     cout<<endl;   
14     cout<<str;
15     return 0;   
16 }   

只有注册用户登录后才能发表评论。
网站导航:   博客园   博客园最新博文   博问   管理