Guest User

Untitled

a guest
Jul 15th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4. #include "ArrayIntStorage.h"
  5.  
  6. int main(int argc, char **argv) {
  7.  
  8. ifstream fin1("ACW2_data.txt");
  9. ofstream out1("1-arrayUnsortedRead.txt");
  10. ofstream out2("2-arrayUnsortedRead-thenSTDSort.txt");
  11.  
  12. if(!fin1.is_open())
  13. {
  14. cout << "FAIL" << endl;
  15. return 1;
  16. }
  17.  
  18. ArrayIntStorage arrayStorage1;
  19. arrayStorage1.setReadSort(false); // do not read sort
  20.  
  21. // read in int values into data structure
  22. fin1 >> arrayStorage1;
  23.  
  24. // output int values in data structure to file
  25. out1 << arrayStorage1;
  26.  
  27. // sort data structure using std
  28. arrayStorage1.sortStd();
  29.  
  30. // output int values in data structure to file
  31. out2 << arrayStorage1;
  32.  
  33. fin1.close();
  34. out1.close();
  35. out2.close();
  36.  
  37. gcc -o myprog myprog.c abc.o -L/path/to/libs -lxyz
Add Comment
Please, Sign In to add comment