Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Read_Files::Read_Files()
- {
- file_end = false;
- inFile.open(file_name);
- if (inFile.fail())
- {
- std::cerr << "Unable to open datafile";
- exit(1);
- }
- }
- void Read_Files::read_next_line()
- {
- std::string line;
- std::getline(inFile, line);
- std::istringstream iss(line);
- unsigned int x, y;
- if ((iss >> x >> y))
- {
- //store values some where.
- }
- else
- {
- inFile.close();
- file_end = true;
- std::cout << "end of file reached" << std::endl;
- }
- }
- 2 3
- 1 4
Add Comment
Please, Sign In to add comment