VC++ 6.0 new & delete HELP!
Hello -
Im trying to work with 2 dimensional arrays and Im STUCK!
I keep gettin assertion failed errors when i try to delete the array? Any Suggestions?
PieceClass **piece;
int i;
piece = new PieceClass *[MAX_WIDTH];
for (i=0;i = new PieceClass [MAX_HEIGHT];
for (i=0;i; // <– fails here 1st time through
delete [] piece;
this same method works fine for a 2 dimensional structure but not this class. What am I doing wrong?
JZ…
</i>
Looks like some of your code got mangled in the post, but when you delete the rows, are you using delete [] there as well:
for (int i = 0; i < width; ++i) delete [] piece;<br><br>delete [] piece;<br> </pre> <br><br>-Brian<br><br>Edited by - osmanb on 3/9/00 9:35:30 PM <br><br>Edited by - osmanb on 3/9/00 9:36:02 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement