I have the following piece of code:
string * p = new string[8]; cout<
which seems ok to me but failed
Yap. new [] pairs with delete []. free()ing causes undefined behavior.
new []
delete []
free()