0

I now want to create an application that will open a .txt file and write something in it, then refresh the .txt file and write something else in the file.

This is what I have done so far:

ofstream file("file.txt");
    system("start file.txt");
    file << "Hello";
    for (int i = 0; i < 3; i++)
    {
        sleep_for(1s);
        file << ". " << endl;
    }
    return 0;

and these are libraries and namespaces:

#include <iostream>
#include <fstream>
#include <windows.h>
#include <chrono>
#include <thread>

using namespace std;
using namespace this_thread;
using namespace chrono_literals;
mrflash818
  • 930
  • 13
  • 24

0 Answers0