bryce burrows
May 11th, 1999, 11:58 PM
Hi
I have a byte * (with memory alloc'd) which basically hold the contents of a file after a CFile::Read
i then want to add more to it...
but when i go to add more allocated memory
with realloc
it doesnt seem to add more memory to that already alloc'd
code
--
earlier
BYTE * image ;
etc etc
size_t imSz = _msize(image);
// add more memory space
size_t newSz = imSz + ((newSize - newPartImageStart)*sizeof(BYTE));
if (realloc(image, newSz) == NULL)
exit(1);
imSz = _msize(image);
what i find here is that imSz hasnt changed a bit!
which is totally weird...
does anyone have any ideas
Regards
Bryce Burrows
I have a byte * (with memory alloc'd) which basically hold the contents of a file after a CFile::Read
i then want to add more to it...
but when i go to add more allocated memory
with realloc
it doesnt seem to add more memory to that already alloc'd
code
--
earlier
BYTE * image ;
etc etc
size_t imSz = _msize(image);
// add more memory space
size_t newSz = imSz + ((newSize - newPartImageStart)*sizeof(BYTE));
if (realloc(image, newSz) == NULL)
exit(1);
imSz = _msize(image);
what i find here is that imSz hasnt changed a bit!
which is totally weird...
does anyone have any ideas
Regards
Bryce Burrows