Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <string>
- #include <sstream>
- void Evolution::read_population_file()
- {
- ifstream file;
- file.open(pathIN, ios::in);
- if (file.good())
- {
- myList<int> m1;
- string line;
- while (getline(file, line))
- {
- istringstream strstrm(line);
- int number;
- m1.clean();
- while (strstrm >> number)
- {
- m1.Add(number);
- }
- population.Add(m1);
- }
- file.close();
- }
- else
- {
- cerr << "file not good\n";
- throw runtime_error("File not good.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement