fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. ifstream in[3];
  6. for (int i = 0; i < 3; i++)
  7. {
  8. in[i].open(this->Files.setFiles[sources[i]]);
  9. in[i].seekg(positions[sources[i]], ios::beg);
  10. }
  11. ofstream out;
  12. out.open(this->Files.setFiles[indexFileForMerge]);
  13. string s[3];
  14. while (true)
  15. {
  16. for (int i = 0; i < 3; i++)
  17. {
  18. cout << in[i].tellg() << ' ';
  19. getline(in[i], s[i]);
  20. cout << s[i].length() << ' ' << in[i].tellg() << '\n';
  21. }
  22. }
  23. return 0;
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:5:11: error: elements of array ‘std::ifstream in [3]’ have incomplete type
  ifstream in[3];
           ^~
prog.cpp:5:11: error: storage size of ‘in’ isn’t known
prog.cpp:8:20: error: invalid use of ‘this’ in non-member function
         in[i].open(this->Files.setFiles[sources[i]]);
                    ^~~~
prog.cpp:8:41: error: ‘sources’ was not declared in this scope
         in[i].open(this->Files.setFiles[sources[i]]);
                                         ^~~~~~~
prog.cpp:9:21: error: ‘positions’ was not declared in this scope
         in[i].seekg(positions[sources[i]], ios::beg);
                     ^~~~~~~~~
prog.cpp:11:14: error: aggregate ‘std::ofstream out’ has incomplete type and cannot be defined
     ofstream out;
              ^~~
prog.cpp:12:14: error: invalid use of ‘this’ in non-member function
     out.open(this->Files.setFiles[indexFileForMerge]);
              ^~~~
prog.cpp:12:35: error: ‘indexFileForMerge’ was not declared in this scope
     out.open(this->Files.setFiles[indexFileForMerge]);
                                   ^~~~~~~~~~~~~~~~~
stdout
Standard output is empty