//请问大家还有别的思路没?
string getPW(char pwCh='*'/*密码代替符,可以自定义*/)  {  //返回加密的密码(password),需要 include <conio.h>
 const int pwLen=17;  //最大密码长度=16
 char pw[pwLen]={0};
 for(int i=0;i<pwLen-1;i++)  {
  pw[i]=getch();
  if(pw[i]=='\r')  {
   cout<<endl;
   return string(pw);
  }
  //else
  cout<<pwCh;
 }
 cout<<endl;
 return string(pw);
}
[分享]昨天一时兴起写的加密密码的小函数,来瞅瞅吧~
											
											
	    

