Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MarkModel::save(const std::string &filename)
- {
- std::ofstream file(filename);
- if(file.is_open()) {
- std::for_each(this->marks.cbegin(), this->marks.cend(),
- [&file](double mark) { file << mark << std::endl; } );
- file.close();
- }
- }
- void MarkModel::load(const std::string &filename)
- {
- std::ifstream file(filename);
- if(file.is_open()) {
- std::string line;
- double mark;
- while( std::getline(file, line) ) {
- mark = std::stod(line);
- this->addMark(mark);
- }
- file.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement