Xom9ik

Cleaner

Oct 8th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <windows.h>
  3. #include <iostream>
  4. #include <fstream>
  5. #include <locale>
  6. #include <vector>
  7. using namespace std;
  8. #pragma comment(linker, "/STACK:16777216")
  9.  
  10. int main()
  11. {
  12.     SetConsoleCP(1251);
  13.     SetConsoleOutputCP(1251);
  14.     vector<string> vec;
  15.     {
  16.         ifstream f("create.txt");
  17.         string line;
  18.         while (std::getline(f, line))
  19.             vec.push_back(line);
  20.     }
  21.     string* massiv = &vec[0];
  22.     for (int i = 0; i < vec.size(); i++)
  23.     {
  24.         char charDelete[2048];
  25.         strcpy_s(charDelete, massiv[i].c_str());
  26.         remove(charDelete);
  27.         if(i%500==0)
  28.             cout << "Delete "<< i << " files" << endl;
  29.     }
  30.     cout << "Deleting " << vec.size() << " files" << endl;
  31.     system("pause");
  32.     return 0;
  33. }
Add Comment
Please, Sign In to add comment