Memory allocated with new is freed with delete, and new[] with delete[].