Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. void Tablica::loadValues() {
  2. fstream file;
  3. file.open(FILE_NAME);
  4.  
  5. int val, size_2;
  6.  
  7. if(file.is_open()) {
  8. file >> size_2;
  9. if(file.fail())
  10. cout << "File error - READ SIZE" << endl;
  11. else {
  12. for(int i = 0; i < size_2; i++) {
  13. file >> val;
  14. if(file.fail()) {
  15. cout << "File error - READ DATA" << endl;
  16. break;
  17. } else
  18. addValue(11, val);
  19. }
  20. file.close();
  21. }
  22. } else
  23. cout << "File error - OPEN" << endl;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement