I have a project and I'm new to C++ Well I have to parse a file.txt that contains transaction informations in an ATM. And there is files named as the date of the transactions. For example the file (20211102.txt) is a file that has all the informations, created in 02/11/2021. So after midnight another file is being created . !! My Objectif is : Every day I have to parse the file from the day before. I have tried a function that generate the date of yesterday. I have to use it But I don"t know how
-Here is the function of parsing the file
void parse()
{
ifstream file1("20211120.jrn");
string str;
if(file1.is_open())
{
while (getline(file1, str))
{
cout << str << "\n";
}
file1.close();
cout << "PARSING FIRST JOURNAL" << endl;
}
else
cout <<"File not found " << endl;
file1.close();
}
I hope it's clear . Thank you in advance.