0

i want this password code in star form. anyone can help.

/*password*/
        LOGINP:
    clrscr();
    printf("\n\n\n\n\nUsername: its_vishuuuu");
    gotoxy(x,y);
    printf("Login\n\n\t\t\tPassword: ");
    fflush(stdin);//covert char to int screen
    gets(pass1);//enter string
    check=strcmp(pass1,password1);//check password
    if(check!=0)
    {
        clrscr();
        goto LOGINP;
    }
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551

2 Answers2

2

In Linux you can use getpass() function. And for alternative see this.

Ghasem Ramezani
  • 2,683
  • 1
  • 13
  • 32
0

If you are using a Linux console, then after each character is read, print char(8) (Ctrl-H), which is backspace, then print an asterisk to overwrite the character that was just input.

Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551