Hey guys,its been awhile, but i've been messing around with C++ again, and i've come to an assignment where i had to create a log in system, but also with the option of adding a new user, now please note that i just mess around with C++ from time to time and im an absolute beginner, my request from you is to tell me could i have done this in any shorter way than mine presented in this code, constructive criticism much appreciated :)
You need a way to keep track of users such as a vector or array of users and passwords.
pass_check should be generalized to handle any number of users and passwords rather than hard coding them.
new_pass_check shouldn't be needed. When you add a user, the standard pass_check function should work for the new user.
What happens if I want to add two new users, then go back and logon as the first new user?
If you really want to generalize this, you should load the users and passwords from a file, then when adding a new user add that username and password to the file.
I appreciate your input very much :D, the thing is the chapter about arrays is coming next for me now after im done with indepth details about Functions and Enumerators i think it was, but i will keep in mind, and yea, the assignment was for really amateur coders so the usernames and passwords were hardcoded just so we'd have a general idea how it would work ,if u get what i mean :) , but now i know that i should pay additional attention to the Arrays chapter,seeing how you suggested me to have used it here.