Thread: password programming

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    1

    Question password programming

    i got proble in coverting the password to '*' style at the same time that user are key in it. so if they anybody can help me in this case?what should i do? please reply me at [email protected]. tq

    #include<iostream>
    #include<string>

    using namespace std;

    class password
    {
    private:
    string name,pw;


    public:

    void pass()
    {
    cout<<"\nEnter New userid"<<endl;
    cin>>name;
    cout<<"Enter New password"<<endl;
    cin>>pw;
    cout<<"\b";
    compare(name,pw);
    }

    void compare(string nm,string kk)
    {
    string nama,ps;
    cout<<"\n\nEnter userid"<<endl;
    cin>>nama;
    cout<<"Enter password"<<endl;
    cin>>ps;

    if(nm==nama && kk==ps)
    cout<<"correct"<<endl;
    else
    cout<<"incorrect"<<endl;
    }
    }



    main()

    {
    password pa;
    char ans,answ;

    cout<<"DO you want to login? Y/N"<<endl;
    cin>>ans;

    while(ans=='Y' || ans=='y')
    {
    cout<<"\n\nAre you the new user? Y/N"<<endl;
    cin>>answ;

    if(answ=='Y' || answ=='y')

    pa.pass();

    else if(answ=='N' || answ=='n')
    {
    cout<<"\n\nSystem already delete your userid and password"<<endl;
    cout<<"You need to register again. Thak you\n\n"<<endl;
    pa.pass();
    }

    else
    cout<<"system refuse"<<endl;

    cout<<"\n\nDO you want to try again? Y/N"<<endl;
    cin>>ans;
    }
    cout<<"\t\t\t\tTHANK YOU TO TRY THE SECURITY SYSTEM"<<endl;
    }

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    AGHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!1



    doesnt anyone read that ****ing faq!
    or site rules!!!

    the amount of streesing that has occured recently you think people would have more sense!

    Search the board - know there are loads of posts on this subject and you will find a solution virtually instantly

    as for emailing it to you - i dont think so !
    come back and find it yourself
    Monday - what a way to spend a seventh of your life

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading a password from a file.
    By medeshago in forum C Programming
    Replies: 15
    Last Post: 12-21-2008, 07:20 AM
  2. [Q]Hide Password
    By Yuri in forum C++ Programming
    Replies: 14
    Last Post: 03-02-2006, 03:42 AM
  3. written command line password generator
    By lepricaun in forum C Programming
    Replies: 15
    Last Post: 08-17-2004, 08:42 PM
  4. Password prompt in unix w/o \b
    By rafe in forum C++ Programming
    Replies: 1
    Last Post: 10-09-2002, 08:54 AM
  5. password
    By hammers6 in forum C Programming
    Replies: 1
    Last Post: 10-10-2001, 12:14 AM