fork download
  1. #include <iostream>
  2. #include <new>
  3.  
  4. int main() {
  5.  
  6. int m = 3;
  7.  
  8. int *chunk = new int[m *2];
  9. int **arr = new int*[m];
  10.  
  11. for (int i = 0; i < m; i++)
  12. arr[i] = new (chunk + i * 2) int[2];
  13.  
  14.  
  15. delete[] arr;
  16. delete[] chunk;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty