Copy merged data to vector?

Started by
12 comments, last by alvaro 9 years, 11 months ago

I know I can sort it, but I can't figure out how to send the data from the first two files into an array...that's my big hold up.

Advertisement

I still don't understand what part of your requirements is not satisfied by my program above.

I guess I thought that it read all the lines from inputs at once rather than one at a time.

I guess I thought that it read all the lines from inputs at once rather than one at a time.

This is the part of my code that reads lines and puts them in the vector:

  std::string line;
 
  while (std::getline(ifs, line))
    lines.push_back(line);

As you can see, it's a loop that runs once per line.

This topic is closed to new replies.

Advertisement