• Advertisement
Sign in to follow this  

How do I properly... dispose of a vector<>

This topic is 1887 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have always used ... unsigned char* when needing to read in bytes...
however, I am using an API that requires me to use a vector.

So this is what I have in my objects .h file


std::vector<unsigned char> image;

Question is... what do I put in my destructor? Do I need to delete it, dispose it, clear it, take it to dinner and a movie? What?

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

Do I need to delete it, dispose it, clear it, take it to dinner and a movie?

You can take it to dinner and a movie, but don't feel you have to. Like most dates, if you just ignore it completely eventually it will go away and leave you to get back to productive programming.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement