SHARE
TWEET

Untitled

a guest Feb 21st, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Выделяем память под каждую часть для первого массива
  2. char **Pack = new char*[20];
  3. for (int i = 0; i<20; i++) Pack[i] = new char[size];
  4.  
  5. for (int i = 0; i<20; i++){
  6.     strcpy(Pack[i] - col*i, fileData);
  7.     cout << Pack[i] << endl << endl << endl;
  8. }
  9.  
  10. //Выделяем память под каждую часть для второго массива
  11. char **NPack = new char*[20];
  12. for (int i = 0; i<20; i++) NPack[i] = new char[col];
  13.  
  14. for (int j = 0; j<20; j++){
  15.     if (j == 19){
  16.         col += ost;
  17.     }
  18.     for (int i = 0; i<col; i++){
  19.         NPack[j][i] = Pack[j][i];
  20.     }
  21.     cout << NPack[j] << endl<<endl;
  22. }
  23.  
  24. free(NPack);
  25. free(Pack);
  26.      
  27. for (int j = 0; j<20; j++){
  28.     if (j == 19){
  29.         col += ost;
  30.     }
  31.     for (int i = 0; i<col; i++){
  32.         NPack[j][i] = Pack[j][i];
  33.     }
  34.     NPack[j][col] = '';
  35.     cout << NPack[j] << endl<<endl;
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top