Undefined behavior on deleting char array trought void *
- by HotHead
Hello!
Is it correct that following yields undefined behavior:
void * something = NULL;
char * buffer = new char[10];
something = buffer;
buffer = NULL;
delete [] something; // undefined??
Do I first need to cast something to void * ?
Thank you!