debug error: damage:after normal block..
Hi,
i have a dynamic byte array "ba". i have used it as follows
BYTE *ba = new BYTE[len]; //len is non zero
ZeroMemory(ba, sizeof(ba)*(len));
memcpy(ba,p_btPgBodyPtr+f_dwStrtTblOff,len);
...
....
....
if(ba)
delete [] ba; //i get debug error out here
can anybody help me solve this problem
thanks
Re: debug error: damage:after normal block..
Code:
BYTE *ba = new BYTE[len];
ZeroMemory(ba, sizeof(ba)*(len));
You are allocating far less bytes (len) than you are using (sizeof(ba)*len).
Note that sizeof(ba) is 'size of pointer to byte' and is not 'size of byte'.