Between lines #66 and #69 although you have opened the file you have done nothing with it, as a result the local variables _user and _pass are empty strings, hence the comparisen returns false for both and puts you down into the else block.
I suggest that you put a delimiter between your fields in the users.txt file. Why are you using a txt file anyway? It would be better to store your data as a bytstream, if you must store it otherwise there isn't any need for the users to enter credentials when someone else can just open the file and see what the cre4dentials are.
You're also overwriting the file everytime someone registers. Find out how to open an existing file if it exists and to append to it. You need to obviscate the data in the file to stop someone from just reading the contents and logging in as someone else.
I have now sorted out the registering part i can add new users without them deleting the user before thats brilliant im getting somewhere now just the log in part. Ive added this to get it to read from file but still doesnt work.
1 2 3 4 5 6
if (new2_data.is_open())
{
cout << new2_data,_user;
cout << new2_data,_pass;
}
Well that's not going to read the file contents into your local variables, which is what I guess you intended. It's just going to write the address of the ifstream variable to the std output i.e. the screen! How were you instructed to read data from a file?
Ive spoke to teacher today an has said he wants the text file data displayed on screen using classes. How do i do that? I have don this so far and i am very stuck. Also thanks for all the help so far.