I am writing C code for 'password prompt' . I need to display * for every character the user enters . But I am not supported with getch(). So , I tried system calls .
for(i=0;i<5;i++)
{
system("stty -echo");
scanf("%c", &a[i]);
system("stty echo");
printf("*");
}
I have tried to turn off echo and get a char and display * enabling echo. But we know scanf continues until \n. So , i am unable to display * at once a char is got. Somebody help me pls. Also kindly suggest me any other better way.