I'm just going to guess what you mean by 'password gate'..
Here is some code I just threw together as an example of console password input. This code will most likely contain bugs, but it should give you the general idea.
Code:
#include <iostream>
#include <conio.h>
using namespace std;
bool GetPassword(char * CorrectPass, int PassMaxLength)
{
char * str = new char[PassMaxLength+1];
char chr;
int InputCounter = 0;
do {
chr = getch();
if(chr == (char)8)
{
if(InputCounter == 0) continue;
InputCounter--;
cout << (char)8 << " " << (char)8;
}
else if(chr != '\r')
{
str[InputCounter] = chr;
cout << "*";
InputCounter++;
}
}
while(InputCounter < PassMaxLength && chr != '\r');
str[InputCounter] = '\0';
if(strcmp(str,CorrectPass) == 0)
{delete[] str; return true;}
delete[] str;
return false;
}
int main()
{
cout << "Password: ";
if(GetPassword("password",100) == true)
cout << "\nCorrect Password!" << endl;
else
cout << "\nYou Suck!" << endl;
return 0;
}
It's quite possible I missunderstood what 'password gate' meant, if I did, just ignore this whole post