Member Avatar for kohkohkoh

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?

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

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.

thank you for your valuable help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.