I am trying to read a config file into a block of storage. How do create a block of storage, like an array of pointers, what would that look like? and how do you get ifstream to send the data to that block?
here's a snippet of my code:
fileIn.open(filename.c_str()); // Opens file for reading
while (!fileIn.eof())
{
fileIn.getline(line, MAX_COMMENTS); // Reads file line by line
if (line[0] == '#') // Searches for comments
{
fileIn >> comments; // Sends comments to string comments
}
while (!fileIn.eof()) // Reads file as long it is not the end
fileIn.getline(line, LENGTH);
I am asking what should go here.
And also, how to create an array of pointers(or some type block of storage) for about 15 lines from a config file.