0

for a simple program...

#include <iostream>
using namespace std;
int main()
{int x;
cout << "enter password\n";
cin >> x;
return 0;
}

for the pink colour part..
if i want my password to be in integer and alphabets, so what command line should i put?

and when i enter a password... i want it to reveal the code in this form "*****". How should i do that?

3
Contributors
3
Replies
4
Views
13 Years
Discussion Span
Last Post by saji
0

for a simple program...

#include <iostream>
using namespace std;
int main()
{int x;
cout << "enter password\n";
cin >> x;
return 0;
}

for the pink colour part..
if i want my password to be in integer and alphabets, so what command line should i put?

and when i enter a password... i want it to reveal the code in this form "*****". How should i do that?

making "int " is replaced by char , you can get show the password in the form of alphabets

0

instead of int use char for entering both int and char data. and u can do this very easily.

#include <iostream>
using namespace std;1
int main()
{
char c,str[20];
int i=0;


while((c =getch())!='\n') {
str=c;
putch('*');
}
}

this program catches the text u type either in int or char. and will be stored in str. each time after accepting the character it will display '*' to hide the characters entered.

Edited by Nick Evan: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.