Set2 while loop does not populate for some reason. Set1 works just fine.
std::stringstream ss;
std::string line;
std::getline(infile, line);
ss.str(line);
int input;
// Populate set1
while(ss >> input)
{
set1.insert(input);
std::cout << "Populate set1 with " << input << "\t pos is " << set1.getUsed() << std::endl;
}
// Populate set2
std::getline(infile, line);
ss.str(line);
std::cout << "\n2nd getline verification: " << line << std::endl;
while (ss >> input)
{
set2.insert(input);
std::cout << "Populate set2 with " << input << "\t pos is " << set2.getUsed() << std::endl;
}
It only populates set1 and not set2. Thank you for your help.
Edit: It reads getline now, thank you. But it doesn't inport the values in "line" to the ss stringstream, so for some reason the second loop for set2 doesn't get recognized.