I’m trying to make a password code, the user enters a password, then it will save the password to a file in /tmp/ and then it will output the password (For me so I can find bugs). I have included the “string” library, and I set the password type to string, but when I output it, it outputs like this:
0x7fffb55baac0password // <-- thats the password I entered
It will output hex (I think), then the password I entered, and it won’t save it to the file in /tmp/ I want it to (Or any file in /tmp/).
Here’s the source code: http://codepad.org/3aamAv7R
Thank you for all the help you guys have given me so far.
password_read is of type ifstream, so what you’re going to get is either junk or its memory address. In order to display what is INSIDE password_read you need to have a variable hold said information.
also:
the constructor of ofstream will open the file for you, so the following line afterwards is ambiguous.