In this function, if a user wants to use the function then it will ask for the password i.e crackneedit. And when the user enters the password it will get printed on the screen as it is
So I want that whenever someone enters a password it is printed in * (asterisk). Which trick should I use?
int pvote()
{
int check;
char *str = "crackneedit";
char pass[11];
printf("Enter your password: ");
scanf("%s",pass);
check = strcmp(pass,str);
if (check == 0)
{
printf("\nVote recorded according to parties are:\n");
printf("PARTY VOTE\n\n");
printf("BJP %d\n",b);
printf("CONGRESS %d\n",c);
printf("AAP %d\n",a);
printf("OTHER %d\n",o);
getch();
return(0);
}
printf("\nACCESS DENIED\n");
return(0);
}