0

Why does my code crash?

After I enter all 3 inputs into the array the program crashes and does not print the values why is this happening? confused https://code.sololearn.com/cV3d88V1uj1O/#cpp

8th Sep 2017, 11:36 PM
Chris
Chris - avatar
1 Answer
+ 4
You have incorrectly initialized your ppp pointer, And its leaking somewhere. Here is the correct way : int*** ppp = new int** [len]; for(int i = 0; i<wid ; i++) { ppp[i] = new int* [wid]; for(int j =0; j<hei ; j++) ppp[i][j] = new int [hei]; }
9th Sep 2017, 4:07 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar