Contents Up << >>

Does "delete p" delete the pointer "p", or the pointed-to-data, "*p"?

The pointed-to-data.

"delete" really means "delete the thing pointed to by." The same abuse of English occurs when freeing the memory pointed to by a ptr in C ("free(p)" really means "free_the_stuff_pointed_to_by(p)").