I have two files, listed on two lines in "input.txt". They both contain similar data, but I don't want to treat them the same way. I open the first one with:
1 2 3 4 5
while (getline(inFile, name)
{
nomFile.open(name, ifstream::in)
...
}
But, this will then try to open my other file "mcFile" the same way and perform the "..." stuff on it. How do I specify to open the first file in "input.txt", operate on it, then open the second file in "input.txt" and operate on it?
getline(inFile, fileName1);
getline(inFile, fileName2);
nomFile1.open(fileName1, ifstream::in);
nomFile2.open(fileName2, ifstream::in);
// Do things with nomFile1
// Do things with nomFIle2