I want to allocate memory for 3d array in c++ one by one like.. 

```
typedef struct {
int id;int use;
}slotstruct;
slotstruct slot1[3][100][1500];  // This should be 3d array
for(i=0;i<3;i++){
  for(j=0;j<100;j++){
     for(k=0;k<1500;k++){
         slot1[i][j][k] = (slotstruct *)calloc(1,sizeof(slotstruct));
      }
   }
}

```

i have used this code but i am getting segmentation fault..