str
is an array of pointers, each of those pointers pointing to a dynamically allocated array.
You need to loop over it and call delete []
on each element.
for(int i=0; i < count; ++i){
delete [] str[i];
}
Note: I have already provided OP with an example using std::vector
, std::string
and std::getline
.