Hi, I tried to downsize a buffer by copying the interesting content it to another, kill the first and set the pointer to the new buffer, something like
MyClass (*)instance[];
void *p;
p=new MyClass[CorrectSize];
memcpy (p, instance, CorrectSize);
//up to now it works as I like it, the debugger shows, the //copy was done: (MyClass*)p[0]=CorrectValue
delete [] instance;
//??? (MyClass*)p[0] =undefined
instance = p
//the buffer is undefined
Does anyone know why?
Thanks, Andreas
Greetings Andreas
MyClass (*)instance[];
void *p;
p=new MyClass[CorrectSize];
memcpy (p, instance, CorrectSize);
//up to now it works as I like it, the debugger shows, the //copy was done: (MyClass*)p[0]=CorrectValue
delete [] instance;
//??? (MyClass*)p[0] =undefined
instance = p
//the buffer is undefined
Does anyone know why?
Thanks, Andreas
Greetings Andreas