Thread: Coding a log in.....

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    13

    Coding a log in.....

    Hi i was wondering if thers a way to make a simple log in coding?

    I can make one but only using numbers, I want to know how to make one with
    actual letters.

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    What do you mean by log in? Log in to a website? If so, why would you be limited to numbers?

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    13
    Quote Originally Posted by Yarin View Post
    What do you mean by log in? Log in to a website? If so, why would you be limited to numbers?
    yea like logging in to a website.

  4. #4
    Registered User
    Join Date
    Jul 2008
    Posts
    13
    Heres my coding

    Code:
    int main()
    {
       int x;
       cout << "please enter password' << endl;
       cin >> x;
       if (x == inputed password)
       { cout << "PASS" << endl;}
        else { cout << "FAIL" << endl;

    but it only does it with numbers,,,How can I make it work with actual letters?

  5. #5
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Use std::string instead of int, and read using getline() instead of cin.

  6. #6
    Registered User
    Join Date
    Jul 2008
    Posts
    13

    Wink

    Quote Originally Posted by MacGyver View Post
    Use std::string instead of int, and read using getline() instead of cin.
    I see back to the books again.
    thanks for you responds and also thanks to yarin too

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 03-20-2009, 05:22 PM
  2. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  3. fprintf works in one function but not in the other.
    By smegly in forum C Programming
    Replies: 11
    Last Post: 05-25-2004, 03:30 PM
  4. My log file player; Hit the brick wall
    By Twig in forum C Programming
    Replies: 6
    Last Post: 07-27-2002, 05:35 PM
  5. Coding Contest....
    By Koshare in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 10-14-2001, 04:32 PM