Advertisement
Derga

Untitled

May 21st, 2023
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <algorithm>
  2. #include <ctime>
  3. #include <iostream>
  4. #include <fstream>
  5. #include <vector>
  6. #include <string>
  7.  
  8. using namespace std;
  9.  
  10. void FillFile(int number_size, const string& file_name) {
  11.     string number = GetNSizeHexNumber(number_size);
  12.     ofstream fout(file_name, std::ios::binary);
  13.     fout << number;
  14.     fout.close();
  15. }
  16.  
  17. int main() {
  18.     //cin cout
  19.     ifstream fin("Finp.bin");
  20.     if (!fin.is_open()) {
  21.         cout << "failed to open " << SOURCE_FILE_NAME << '\n';
  22.         return -1;
  23.     }
  24.     else {
  25.         fin >> number;
  26.     }
  27.     fin.close();
  28.  
  29.     //запись числа в файл
  30.     const string DESTINATION_FILE_NAME = "Fout.bin";
  31.     //cout
  32.     ofstream fout(DESTINATION_FILE_NAME);
  33.     fout << n_in_o;
  34.     fout.close();
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement