This is code from a class implemented into one of my frameworks. I hope it helps
#define std::string stdString
#define std::vector stdVector
void Floader::loadDataFromFile(const char *fileName){
int i;
resetData();
stdString line;
fstream myFile(fileName);
for (i=0; myFile.good(); i++) {
getline(myFile,line);
loadedData.push_back(line);
}
myFile.close();
stdCout << "Process completed\n";
} The loadedData is a vector holding strings.
This will read a file and will make the vector hold each line of the file. I hope it helps.