i may be doing this wrong. im trying to open two files, assign the text inside to the variables logginname and pass. Then the users input is set to valun and valpw. then i try to compare them with an if statement.
Code:void login() { char valun[256]; char valpw[256]; ifstream a_file ("bin/liun.dat"); a_file>> loginname; a_file.close(); ifstream b_file ("bin/lipw.dat"); b_file>> pass; b_file.close(); cout<<"\n\n------------------------------------------------\n\n"; cout<<"Please enter your username:"; cin>> valun; cout<<"\nPlease enter your password:"; cin>>valpw; if (valun == loginname && valpw == pass){ cout<<"\n\nVALIDATING....\n\n\n"; cout<<"ACTION CODE [757365722065786973747300] USER EXISTS!"; } else { cout<<"VALIDATING....\n\n\n"; cout<<"INTERNAL ERROR [75736572206E6F6E206578697374656E7400]"; cin.get(); return; } cout<<"\n\n----------------------------------------------------\n\n"; cout<<"PRESS ENTER TO CONTINUE TO CONTROL CENTER...\n"; cin.get(); desktop(); }