Short statement of the problem: User can set password to protect the program from being run by someone else.
Password is then changed into multiple ints and saved to file using char table[x] containing all reasonable characters. Then, if password is set, program opens the file, decodes the ints back to characters and sets it to
char passwordset[x] and asks the user to enter password (
cin>>password).
Then uses
strcmp(password,passwordset) to check whether or not they are same. Still it doesn't work.
I cout'ed passwordset to compare it with input password just for debugging and it returns '
noname' (example password) as well as
character printed out as space (' '), but obviously
being something else. What is the explanation of this problem and does anyone have any solution?
Thanks in advance :)
---------------------------------------------------------------------------------------------------
In addition, if it's of any help, i used
pwfileout<<z<<' '; to save the file and reading file is stopped with
do{...}while(pwfilein.eof()==0);.