fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <fstream>
  4. #include <array>
  5. #include <iterator>
  6.  
  7. struct GUID { char data[16];};
  8.  
  9. std::istream& operator>>(std::istream& in, std::pair<GUID, std::array<double, 13>>& var)
  10. {return in.read((char*)&var, sizeof(var));}
  11.  
  12. std::vector<std::pair<GUID, std::array<double, 13>>> loadGUIDs()
  13. {
  14. std::vector<std::pair<GUID, std::array<double, 13>>> ret;
  15. ret.reserve(5400); //or sizeof file / 120b or whatever
  16. std::ifstream infile("GUIDs.bin");
  17. std::istream_iterator<std::pair<GUID, std::array<double, 13>>> begin(infile),end;
  18. ret.assign(begin,end);
  19. return ret;
  20. }
  21. static const std::vector<std::pair<GUID, std::array<double, 13>>> engVals = loadGUIDs();
  22.  
  23. int main() {
  24. // your code goes here
  25. return 0;
  26. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Standard output is empty