Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Problem when growing a vector
Problem when growing a vector [message #42313] Thu, 06 March 2014 17:10 Go to next message
NeilMonday is currently offline  NeilMonday
Messages: 15
Registered: May 2013
Promising Member
Hello, I am seeing some behavior that I do not understand when adding to a Vector. I understand that a Vector needs to grow to accommodate new elements. However, it appears that some of my elements are being de-allocated when the Vector grows. Can anyone help me understand why this happens and how I can prevent my elements from being deleted?

Before growing the Vector
http://i.imgur.com/CEl4L46.png

After growing the Vector
http://i.imgur.com/byc9JSG.png
Re: Problem when growing a vector [message #42314 is a reply to message #42313] Thu, 06 March 2014 19:09 Go to previous messageGo to next message
NeilMonday is currently offline  NeilMonday
Messages: 15
Registered: May 2013
Promising Member
It appears this must just be a bug with the debugger? When I set out[8] and out[13] to a String they set the correct value, but the debugger still shows "FreeFreeFree...". So I guess I will just keep in mind that the debugger values aren't always as they seem.
Re: Problem when growing a vector [message #42316 is a reply to message #42314] Fri, 07 March 2014 00:56 Go to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
NeilMonday wrote on Thu, 06 March 2014 10:09

So I guess I will just keep in mind that the debugger values aren't always as they seem.


Good idea as the finished results are what really counts.
Different OSs and computer setups may have problems with the debugger. You can also try print statements in you code.
Previous Topic: Pointer on Labels defined in lay.h
Next Topic: SQL : how to prevent duplicates ?
Goto Forum:
  


Current Time: Sun Jun 16 18:04:42 CEST 2024

Total time taken to generate the page: 0.02565 seconds