Original Post
Well, I have a 2D array of tiles for my map, but when I try to delete[] them, sometimes it causes an error, and sometimes it just exits, but leaves the VC++ window deselected (err, whatever you call it when the title bar''s grey^^). Here''s the code I use to create it, then the code to delete it
Anybody know how to make it work? I need to get to work on the actual tile engine, but I can''t until the destructors working or I''ll end up having to reset every once in a while to clear out my RAM...
-Deku-chan DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^) "I'm dropping like flies!" - me, playing Super Smash Bros. (and losing) "What fun!" - me, playing Super Smash Bros. (and beating the crap out of somebody)
grid = new tile*[x];
if(*grid)
{
for(int i = 0; i < x; i++)
grid<i> = new tile[y];
}
if(grid)
{
for(int i = 0; i < x; i++)
delete [] grid[i];
delete [] grid;
}
|
-Deku-chan DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^) "I'm dropping like flies!" - me, playing Super Smash Bros. (and losing) "What fun!" - me, playing Super Smash Bros. (and beating the crap out of somebody)