Jump to content

string


Devexz
 Share

Recommended Posts

O getch le-te UM caracter.

Acho que não há uma função que capture uma string sem aparecer no ecra.

Vais ter de fazer um ciclo e fazer N getch até ser clicado o ENTER.

Oracle Certified Professional - AdministraçãoOracle Certified Professional - Pl/sqlMCPD - Microsoft Certified Professional DeveloperMCTS - Microsoft Certified Technology Specialist

Link to comment
Share on other sites

Tipo isto:

	char letra;
string pw;
while (couz != 13) //13 corresponde a enter
{
	letra = _getch();
	pw.push_back(couz);
	if (couz != 13)
		cout << "*";
}

Este mostra um * por cada tecla pressionada.

Penso ser fácil o suficiente de modificar caso este não seja o efeito pretendido.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.