Welcome to Dream.In.Code
Getting Help is Easy!

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




Free memory used by vector

 
Reply to this topicStart new topic

Free memory used by vector, Free memory used by vector

lijojacobcs
post 21 Apr, 2006 - 07:21 AM
Post #1


New D.I.C Head

*
Joined: 9 Mar, 2006
Posts: 5


My Contributions


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.
User is offlineProfile CardPM

Go to the top of the page

Thorian
post 21 Apr, 2006 - 07:41 AM
Post #2


Pirate Medic

Group Icon
Joined: 6 Jun, 2002
Posts: 5,736



Thanked 4 times

Dream Kudos: 275
My Contributions


Hello Memory vector guy Im going to transfer this to general programming as it does not appear to be an introduction
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 21 Apr, 2006 - 10:26 AM
Post #3


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


CODE

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.
User is offlineProfile CardPM

Go to the top of the page

Wazaa
post 21 Apr, 2006 - 12:19 PM
Post #4


New D.I.C Head

*
Joined: 10 Apr, 2006
Posts: 9


My Contributions


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:
CODE

vector._Destroy();

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

Daniel
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 03:08AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month