//Print decrypted contents
void print(ifstream& infile)
{
char file;
vector<char>read;
int i = 0;
//Read infile to vector
while (!infile.eof())
{
infile >> file;
read.push_back(file);
}
//Print read vector
for (i = 0; i < read.size(); i++)
{
cout << read[i];
}
}
Whenever I run it it recognizes an incorrect password but with the correct password it just goes straight to system pause without printing anything. What am I doing wrong?
> but with the correct password it just goes straight to system pause
the only system("pause"); that you have is in line 6 when you can't open the file. There is no such thing in the "correct password" path.
¿what's the point analysing code that doesn't correspond with your symptoms?
Also, you need to learn to simplify your testcase. You think that the problem is with printing, ¿how is the password thing relevant?