Hi.
I am trying to safe a password but I fail because he don't seems to read it, I can't figure it out. Here is some code:
Code:
First of I gave it some kind of 'default' setting:
#include <fstream>
#include <iostream>
#include <math.h>
#include <windows.h>
using namespace std;
//here is some other code, not necessary now
char ThePassword[] = "password";
int main()
{
ifstream A ( "Startup.txt" );
A.close();
//here is some other code, not necessary now
}
then later in the code you can change the password in a option ( if
you want to change the password )
//here is some other code, not necessary now
ofstream B ( "Startup.txt" );
B<< ThePassword<<endl;
B.close();
//here is some other code, not necessary now
but the problem is he doesn't seem to read the file he wrote, first
he get's the 'default' password then he read's the file, so if there
isn't a file, he wont read it, then you can give it an other password
he save's that then if you close program and open up again he
read's 'default' password but then he read's the file that now Does
exist so the ThePassword should get a other value but he doesn't
read the file and I don't know why, please help me.
( if there's isn't enough code plz tell me, i can add some more, thank you )