Hi. I've created a log in program that allows the user to first, create an account, then log in using the same username and password. when they try to log in with their username and password, I need the program to find that username and password in the csv file and match the two passwords. in the csv file, the username is on one row ( User: ) and the password on the row under ( pass: ), all the same column.
the getline function at the end displays all username's and password's. I need to match the one specific password underneath the input username. Thanks
A simple note on syntax. It is much nicer to list the {} on seperate lines and have the stuff inbetween incremented by 3 spaces.
1 2 3 4 5 6 7 8 9 10
if
{
stuff
stuff
}
else
{
stuff
stuff
}
Simply easier to read. No worries though.
Looking at your code you run the chance of not closing your file. If you put in 1 it doesn't close. If you put in 2 it closes a not open file.
thanks for the tip on syntax, but it doesn't really answer my question. I need to find and read the password from the csv file.
I do use a tab like edithsong's example. must've forgot one line. Thanks for the tips.
I think you would benefit from having functions to show the menu and to process the users selection. then have a function to carry out each menuoption.
There are problems with the braces, causing you to not get the logic you want.