For this:
m_sFilename = new char [len+1];
Should I call delete[] m_sFilename;
sometime?
And:
should I use delete[] m_sFilename
or delete m_sFilename;
?
Does "new char[]" need to be release resouces manually?
Yes.
For this:
m_sFilename = new char [len+1];
Should I calldelete[] m_sFilename;
sometime?
Yes.
Should I use
delete[] m_sFilename
ordelete m_sFilename;
?
delete[]
.
But you should actually use std::string
, which does all this for you, and is free.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With