#include
#include
#include
char Getch()
{
char ch;
struct termios oldt, newt;
tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;
newt.c_lflag &= ~(ECHO|ICANON);
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
ch = getchar();
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
return ch;
}
void getpasswd(char *p)
{
int i=0;
printf("password:");
while((*(p+i)=Getch())!='\n')
{
putchar('*');
i++;
}
*(p+i) = '\0';
}
int main()
{
char a[10];
getpasswd(a);
printf("%s",a);
}