I want to use the system date I have from the computer and use it as the name of the .txt file. Here's what I have so far:
void idle_time()
{
LASTINPUTINFO last_info;
last_info.cbSize = sizeof(LASTINPUTINFO);
int tickCount = 0;
int minutes = 0;
int count = 0;
SYSTEMTIME a;
while(true)
{
    GetLastInputInfo(&last_info);
    tickCount = GetTickCount();
    int minutes = (tickCount - last_info.dwTime) / 60000;
    count++;
    string date;
    date += a.wMonth;
    date += "/";
    date += a.wDay;
    date += "/";
    date += a.wYear;
    if((minutes >= 1) && (count%3000==0))
    {
        //std::string filename = date;
        //filename += ".txt";
        ifstream in(string(date + ."txt").c_str());
        float sum;
        in >> sum;
        sum++;
        in.close();
        ofstream out(string(date + ".txt").c_str());
        out << sum;
        out.flush();
        out.close();
    }
I'm sorry for the terrible indentation. This editor doesn't do it justice. But anyway, how would I use the date as the filename?
 
     
    