Okay, so i was trying to make this work.
Two queues need to be created using input from the user for 2 file names.
For some reason I get 1 queue, the first one filled. Then the second queue never has anything in it. Please help me with better code, or help me with this code. Thanks alot!
sample1:
2
3
4
-1
sample2:
4
5
6
-1
void WorkForce::MakeDoubleQueue() {
char input1[256], input2[256];
cout << "Please enter a name for input file ONE: ";
cin >> input1;
ifstream myfile, openagain;
myfile.open(input1);
while (!myfile.eof())
{
int i;
myfile >> i;
q1.push (i);
}
myfile.close();
//do the above again for input file TWO
cout << "Please enter a name for input file TWO: ";
cin >> input2;
openagain.open(input2);
while (!openagain.eof())
{
int k;
myfile >> k;
q2.push (k);
}
openagain.close();
} //end of MakeDoubleQueue