Coding a log in.....

This is a discussion on Coding a log in..... within the C++ Programming forums, part of the General Programming Boards category; Hi i was wondering if thers a way to make a simple log in coding? I can make one but ...

  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
    1,691
    What do you mean by log in? Log in to a website? If so, why would you be limited to numbers?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  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,211
    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, 06:22 PM
  2. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 02: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, 04:30 PM
  4. My log file player; Hit the brick wall
    By Twig in forum C Programming
    Replies: 6
    Last Post: 07-27-2002, 06:35 PM
  5. Coding Contest....
    By Koshare in forum A Brief History of Cprogramming.com
    Replies: 46
    Last Post: 10-14-2001, 05:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21