Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. bool validateUser(string theAccounts[5][7], string username, string password, int *saveRow)
  2. {
  3. bool passed = false;
  4. int user = 0;
  5. int pass = 4;
  6. int row = 0;
  7.  
  8. // For loop passing through theAccounts array finding matching username + password.
  9. // Returns false if no match is found.
  10. for (int row = 0; row <= 4; row++)
  11. {
  12. if (username == theAccounts[row][user] && password == theAccounts[row][pass])
  13. {
  14. passed = true;
  15. saveRow = row;
  16. }
  17. }
  18.  
  19. return passed;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement