C++ Password Fuction

Could someone help me with a problem i have I need a password function in my code not sure how to do it any help be much appreciated please help thanks

Comments

  • Is there just one password that
    is the key or is it thousands?
    [hr]
    El PROgrammador Niklas Ulvinge
    (who doesn't know how to spell in inglish)

  • : Is there just one password that
    : is the key or is it thousands?
    : [hr]
    : El PROgrammador Niklas Ulvinge
    : (who doesn't know how to spell in inglish)
    :
    :
    well both cause i need an 1 admin password for 1 file and then 20 staff passwords or so if u get my drift
  • : Could someone help me with a problem i have I need a password function in my code not sure how to do it any help be much appreciated please help thanks
    :
    :

    what kind of password function do you want -- one that displays * when you type a character? If yes, use getch() that's in conio.h, assuming your compiler supports it, which it may or may not.
  • : : Could someone help me with a problem i have I need a password function in my code not sure how to do it any help be much appreciated please help thanks
    : :
    : :
    :
    : what kind of password function do you want -- one that displays * when you type a character? If yes, use getch() that's in conio.h, assuming your compiler supports it, which it may or may not.
    :
    thanks but i don't know the coding of it any help out there please, how use strcampare and i'm using c++
  • [b][red]This message was edited by stober at 2005-3-31 19:36:18[/red][/b][hr]
    : : : Could someone help me with a problem i have I need a password function in my code not sure how to do it any help be much appreciated please help thanks
    : : :
    : : :
    : :
    : : what kind of password function do you want -- one that displays * when you type a character? If yes, use getch() that's in conio.h, assuming your compiler supports it, which it may or may not.
    : :

    : thanks but i don't know the coding of it
    Ok this is how to use it. Note that it does not handle backspace, delete key, arrows, or other special keys. You will have to code that yoursef.
    [code]
    int main()
    {
    int key;
    while( kbhit() )
    {
    key = getch();
    if( key == 0)
    {
    // special key such as was hit
    // make negative so that you can tell the
    // difference between special key and normal key
    key = -getch();
    }
    putc('*')
    }
    }
    [/code]


    any help out there please, how use strcampare and i'm using c++
    :

    There is no such function as strcompare(). But here's an example of
    comparing two c++ strings.
    [code]
    std::string str1 = "Hello World";
    std;:string str2 = "World";

    if( str1 == str2()
    {
    cout << "The two strings are the same";
    }
    else
    {
    cout < "The two strings are different
    }
    [/code]


  • I have a menu fuction at startup the main menu, then I have a choose of going into administration menu, purchase menu, stock menu, but I want a function like

    if (Username == Username1 && Password == Password1)
    Enter into Admin Menu

    i am using ms c++
  • : I have a menu fuction at startup the main menu, then I have a choose of going into administration menu, purchase menu, stock menu, but I want a function like
    :
    : if (Username == Username1 && Password == Password1)
    : Enter into Admin Menu
    :
    : i am using ms c++
    :
    You could hide the option administration menu.
    I don't know c++ that well though so I don't really know.
    [hr]
    El PROgrammador Niklas Ulvinge
    (who doesn't know how to spell in inglish)

  • : I have a menu fuction at startup the main menu, then I have a choose of going into administration menu, purchase menu, stock menu, but I want a function like
    :
    : if (Username == Username1 && Password == Password1)
    : Enter into Admin Menu
    :
    : i am using ms c++
    :

    Huh? I don't get it. What do you need to write a function like that for? Just compare them like you posted, assuming all variables are std::string objects.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories