Is it better to use arrays, list, or vector for the below code? It works but I am just not sure of the most efficient way to do it:
//reverse print out of file read
#include <iostream> //cout and cin
#include <string> //used to manipulate strings
#include <fstream> //used to open files for reading and writing
#include <vector>
using namespace std;
int main()
{
vector<string> v;
ifstream in("vector.txt");
string line;
while(getline(in,line))
v.push_back(line); //add the line to the end
//add line numbers
vector<string>::reverse_iterator v2;
for (v2 = v.rbegin(); v2 != v.rend(); v2++)
cout << *v2 << endl;
}