One easy way is to use strings and a vector....read a line into a string and push it onto the vector.....maybe not the most efficient way...but simple
Code:
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
int main (int nArg,char* szArg[]){
if(nArg < 2){
std::cout << "Only pass the name of the file!" << std::endl;
return 1;
}
std::ifstream in(szArg[1]);
if(!in.is_open()){
std::cout << "Couldnt open the file!" << std::endl;
return 1;
}
std::vector<std::string> vec;
std::string str;
while(!in.eof()){
getline(in,str);
vec.push_back(str);
}
for(int i = 0;i < vec.size();i++)
std::cout << vec[i] << std::endl;
}