new
what you delete
, and free
what you malloc
(don't mix them, you'll get into trouble). Sometimes you have to use new, as data allocated with new will not fall out of scope... unless the data pointer is lost, which is the entire issue with new
.
But that is err on the side of the programmer, not the keyword.