>"I'm going to kill your computer if you dont enter the right password!!!"
Uh huh.
>main(); //go to main to do until success
It's illegal to call main recursively in C++.
>teach me how to only let the user have 34 tries before it close
// Pseudo-C++
int n = 0;
while ( n < 34 ) {
if ( is_right_password() )
break;
++n;
}
if ( n == 34 )
exit ( EXIT_FAILURE );
// Do stuff for correct password
>encrypt the password to a file then decrypt it and compare it to
>another file that contain the correct password
Do you know how to read from a file? If not then it would be best to consult your C++ book (you do have one, right?). The encrypting and decrypting part is a little more difficult depending on your needs, but we'll get to that once you have a program that works with plain text. Those are easier to test for correctness.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004