School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 358,290 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,482 people online right now.Registration is fast and FREE... Join Now!



Free memory used by vector

52 Weeks of Code Challenge: Android

Week #11 of the 52 Weeks of Code Challenge is Android, you should give it a shot. Click Here!

Free memory used by vector Free memory used by vector Rate Topic: -----

#1 lijojacobcs  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 09-March 06


Dream Kudos: 0

Posted 21 April 2006 - 07:21 AM

What is the function to free the memory used by a dynamic vector array?I am using push_back to insert into the vector. Instead of deleting the vector one by one from the array, I want to delete the entire array of vectors simultaneously.
Was This Post Helpful? 0
  • +
  • -


#2 Thorian  Icon User is offline

  • Pirate Medic
  • Icon

Reputation: 16
  • View blog
  • Posts: 5,856
  • Joined: 06-June 02


Dream Kudos: 275

Re: Free memory used by vector

Posted 21 April 2006 - 07:41 AM

Hello Memory vector guy Im going to transfer this to general programming as it does not appear to be an introduction
Was This Post Helpful? 0
  • +
  • -

#3 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • Icon

Reputation: 186
  • View blog
  • Posts: 13,403
  • Joined: 12-July 02


Dream Kudos: 25

Re: Free memory used by vector

Posted 21 April 2006 - 10:26 AM

delete[] myVectorArray;


unless I've misuderstood...presuming you've allocated the memory with the new operator. Also presuming you are using C++, or a similar language. Please advise if not.
Was This Post Helpful? 0
  • +
  • -

#4 Wazaa  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 10-April 06


Dream Kudos: 0

Re: Free memory used by vector

Posted 21 April 2006 - 12:19 PM

It's quite hard to understand what you mean. Half of your text implies that you got an array with dynamic vectors, while the other half says that you got a single vector. What Amadeus said is for the array that contains vectors, but for the single vector - just use:
vector._Destroy();


But probably I've misunderstood something - misunderstanding is an area in which I'm an expert. :)

Daniel
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month