Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include "factor.h"
- using namespace std;
- void in_thread(string& in_file, string& out_file, factor& A)
- {
- ifstream fin(in_file);
- ofstream fout(out_file);
- uint64_t current;
- while (!fin.eof())
- {
- fin >> current;
- A.createFactor(current);
- fout << A.getString() << std::endl;
- }
- }
- int main()
- {
- factor A;
- string in_file, out_file;
- cout << "Input file: " << std::endl;
- cin >> in_file;
- cout << "Output file: " << std::endl;
- cin >> out_file;
- thread func_thread(in_thread, in_file, out_file, A);
- if (func_thread.joinable())
- func_thread.join();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement