I'm trying to hide the password as the user enters it, but for some reason it's not working. it seems like an infinite loop:


Code:
string get_password()
{
   string give_back;
   char temp;
   while(cin.get(temp) != 0)
   {
      //give_back += temp;
      cin.putback('*');
      
   }
   
   return give_back;
}