0

I have a problem. I want to read each line from 'lol.txt'. What I have so far doesn't seem to work. Here is my code:

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
ofstream file("lel.txt", ios::app);
ifstream file2("lol.txt");

//string write;
//getline(cin, write);
//file << write << "\n";
//file.close();
//}

string;
file2 >> read;
getline(cin, read);
cout << read;
}

Thanks!

P.S.: I am using Ubuntu and Code::Blocks.

kuroi neko
  • 8,479
  • 1
  • 19
  • 43

0 Answers0