Thread: compiling error
View Single Post
Old Nov 2nd, 2006, 6:36 AM   #36
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
Since you allocted pixels as one block of char, it is a very bad idea to try to delete[] the chars individually. You either can leave the block at its original size (and have some unused memory) or allocate a new block, copy the contents you want across and then delete the old block.

As for copying the data across to the new size, you need to keep track of the old size and use that to find the location of the pixels you want to copy from the old data.
The Dark is online now   Reply With Quote