fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Person
  5. {
  6. Person(bool) {}
  7. };
  8.  
  9. int main(int argc, char *argv[])
  10. {
  11. size_t X=atoi("7");
  12. size_t Y=atoi("5");
  13.  
  14. Person ***population = new Person **[Y];
  15. for(size_t y=0;y<Y;++y) population[y]=new Person*[X];
  16. for(size_t y=0;y<Y;++y) for(size_t x=0;x<X;++x) population[y][x]=new Person(true);
  17.  
  18.  
  19. for(size_t y=0;y<Y;++y) for(size_t x=0;x<X;++x) delete population[y][x];
  20. for(size_t y=0;y<Y;++y) delete[] population[y];
  21. delete[] population;
  22. return 0;
  23. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty