A
Alf
Hi, I've got myself confused as to when I should delete memory and when the
system will do so automatically.
I'm using strtod() in a function
char *stopstring;
double x = strtod( txtBuffer,&stopstring );
Must I free any memory allocated to stopstring or is it done automatically
when I exist the function?
I am a bit confused as I have seen this microsoft example (using c++)
char* lpszText2 = _com_util::ConvertBSTRToString(bstrTag);
which explicitely deletes the memory at the end of the function, thus:
delete[] lpszText2;
Similarly say any function returns a char *.
Say,
char *p;
p=charpreturned();
should I free the memory in the calling routine?
Thanks
system will do so automatically.
I'm using strtod() in a function
char *stopstring;
double x = strtod( txtBuffer,&stopstring );
Must I free any memory allocated to stopstring or is it done automatically
when I exist the function?
I am a bit confused as I have seen this microsoft example (using c++)
char* lpszText2 = _com_util::ConvertBSTRToString(bstrTag);
which explicitely deletes the memory at the end of the function, thus:
delete[] lpszText2;
Similarly say any function returns a char *.
Say,
char *p;
p=charpreturned();
should I free the memory in the calling routine?
Thanks