Someone looking at my code today told me that I didn't need to delete a pointer I declared in one place because I didn't create it using the "new" operator and went on to say that you only have to delete them when you use the "new" operator to declare them. Is this accurate? Relevant code included, the pointer is to a vector object within a struct named "pParams".
/*use parameter name to determine which member of the
pParam struct should be affected*/
void Cfg::proc_param(string name, string value)
{
vector<string> *param_vector;
bool bad_param_name = false;
if (name == "dirs_recursive")
param_vector = &pParams.dirs_recursive;
else if (name == "dirs_nonrecursive")
param_vector = &pParams.dirs_nonrecursive;
else if (name == "files")
param_vector = &pParams.files;
else
cout << "Invalid configuration paramter " << name << endl;
bad_param_name = true;
delete param_vector;
}