Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Includes Prototypes to some widows specific functions...
- #include "Functions.h"
- int main ()
- {
- SetColor(); // Sets Text Colour to White
- string Pass;
- vector<char> Password;
- cout << "Set Password: ";
- getline(cin,Pass);
- for (int i = 0; i < Pass.size();i++)
- Password.push_back(Pass[i]);
- vector<char> Entry;
- Entry.reserve(10);
- cout << "Password: ";
- int a;
- for (int i =0;i>-1;i++)
- {
- a = i;
- Entry.push_back(readkey()); //readkey() returns ASCII code of the Key pressed...
- cout << Entry[i];
- if (Entry[i] == 13)
- break;
- ClearScreen(); //As the name suggests, Clears the screen
- cout << "Password: ";
- Entry[i] = toupper(Entry[i]);
- for (int j = 0; j < a+1;j++)
- {
- cout << "*";
- if (Entry[i] == 8)
- {
- a -= 1;
- cout << "\b";
- }
- }
- if (Entry[i] == 8)
- {
- i--;
- Entry.pop_back();
- }
- }
- Entry.pop_back();
- bool X = false;
- for (int i = 0; i <Entry.size() && i< Password.size();i++)
- {
- if (Entry[i] == Password[i])
- {
- X = true;
- }
- else
- {
- X = false;
- break;
- }
- }
- if (X)
- cout << "\nCorrect Password . . .";
- else
- cout << "\nIncorrect Password . . .";
- PressAnyKey();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment