If data is a string with a null terminate character, will std::string copy all the characters from data?Code:std::string new_str = data;
free(data);
So am i safe to free the data pointer?
Thank you.
Printable View
If data is a string with a null terminate character, will std::string copy all the characters from data?Code:std::string new_str = data;
free(data);
So am i safe to free the data pointer?
Thank you.
Yes and yes.
Thank you!!!
Question is, why are you using malloc() and free()?