#include <iostream>
using namespace std;
int main()
{
int rows = 3, columns = 3;
int ****p;
p = new int***();
*p = new int**();
**p = new int*[rows];
for(int i = 0; i < rows; i++)
{
***(p+i) = new int [columns]; //Crashed at ***(p+1) why?
}
}
I'm trying to make this code work but the compiler keep crashing when i try to run it. I narrowed the problem to the commented line. I don't understand why?