its_vishuuuu
its_vishuuuu

Reputation: 11

Password in star form

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;
    }

Upvotes: 0

Views: 191

Answers (2)

Mawg
Mawg

Reputation: 40185

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.

Upvotes: 0

Ghasem Ramezani
Ghasem Ramezani

Reputation: 2888

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

Upvotes: 2

Related Questions