#include <iostream>
#include <string>
#include <fstream> //write and read
//#include <ifstream> //read
//#include <ofstream> //write
int main () {
std::string line;
std::ofstream myfileWrite;
std::ifstream myfileRead;
myfileWrite.open("example.txt");
myfileRead.open("example.txt");
myfileWrite << "Writing this to a file.
";
while (getline(myfileRead,line)){
std::cout << line << '
';
}
myfileWrite.close();
myfileRead.close();
return 0;
}