35657

Untitled

Jan 25th, 2024
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8.    
  9.     // процесс создания и удаления двумерного динамического массива 5 * 5
  10.  
  11.     int** arr = new int* [5];
  12.  
  13.     for (int i = 0; i < 5; i++) {
  14.         arr[i] = new int[5];
  15.     }
  16.  
  17.     arr[3][3] = 100;
  18.     cout << arr[3][3] << endl;
  19.  
  20.  
  21.     for (int i = 0; i < 5; i++) {
  22.         delete[] arr[i];
  23.     }
  24.  
  25.     delete[] arr;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment