I was given this code from a thread that I created (i cannot remember who) and I would like somebody (preferably the same person who gave it to me) to explain what each line does ('cause i've got no idea). And also, when I compile it (in MSVC++ 6.0), it does nothing but sit there!! It is meant to display all of the lines of a text file. I really wanted it to store each line in a variable if it wasn't empty, but anyway.....
...here is the code:
using namespace std;
ifstream file("myfile.txt"); // or whatever
if(!CurrentLine.empty()) // store it if not empty
// show the stored lines
for(int i = 0; i < Lines.size(); i++)
cout << Lines[i] << endl;