#include <fstream> // iostream isn't required for using fstream
using namespace std;
int main() {
fstream file;
file.open("file.txt"); // Replace file.txt with your own filename
// Reading from files
string input; // A variable is needed for reading from files
file >> input; // Reads the text in the file and saves it to input
// Writing to files
file << "Hello World!";// << endl;
file.close();
return 0;
}