I want to read and write string from file, - Dont want to overwrite on the existing file
So you want to read a string from a file and write it to another file?
You haven't really explained what you are trying to do.- Where to put the read file code as in Constructor if file is not created then it will generate error.
If the file doesn't exist then youwant it to generate an error don't you?
A couple of code notes though:
if(infile.fail())Error("Can't read the Data file "); You should stop here. If there is no data to read then the function should not continue.
return password.getValue(ConvertToUpperCase(login))==pass?true:false; The ternary operator operates on a conditional, so what you are doing is saying 'if true: return true. if false: return false'. Skip the check and just return the conditional:
return (password.getValue(ConvertToUpperCase(login))==pass);