Hi every one. I have only been programming for a few months now , and I am already stuck.
I have currently been trying to develop a new security program for websites , but have come across a few minor difficulties - when the user types the password , any one can see it. I need a way of replacing any characters with *.
Here is the code so far :
Code:
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char userid[501];
char password[501];
cout<<"Security program initiated.\n\n\n\n";
cout<<"Enter your user ID : ";
cin.getline (userid , 501 );
cout<<"\nEnter your password : ";
cin.getline (password , 501 );
while (strcmp (userid, "41149512")== 1||strcmp ( password, "solaris" ) == 1 ) {
cout<<"\n\n\nInvalid user ID or password. Please try again.\n\n\n";
cout<<"Enter your user ID : ";
cin.getline (userid , 501 );
cout<<"\nEnter your password : ";
cin.getline (password , 501 );
};
if (strcmp ( userid, "41149512" ) == 0&&strcmp ( password, "solaris" ) == 0 ){
cout<<"\n\n\nVerifying user ...\n\nUser identified.\nWelcome back.\n\n\n<< Press Enter to continue >>";
};
cin.get();
return 0;
}
Also , it comes up with lots of errors on line 54 , but there are only 35 lines in the program according to the compiler.
This is really confusing me. I think it may be a header file , but I'm not sure. Please help !