I am having trouble deleting a dynamic matrix in Vis Studio .net. I am almost positive this code works in G++, have any ideas??
- Code:
//creation seems to work fine
short **mapTiles=NULL;
mapTiles=new short*[mapX];
for(int i=0;i<mapX;i++)
{
mapTiles[i]=new short[mapY];
}
//after being created, various functions dont seem to have a problem with this
//having trouble with deletion
if(mapTiles!=NULL)
{
for (int i = 0; i < mapX; i++)
{
delete []mapTiles[i];
}
delete []mapTiles;
}