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 » Coffee corner » Strange program crash
Re: Strange program crash [message #39178 is a reply to message #39177] Sat, 23 February 2013 05:18 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
You don't need to set the size in front.

If you know you will need that many nodes, you may want to Reserve(MAX_ROW);

If for some reason you want the vector to be with that many nodes, you can use the At() method of Upp::Vector, but be advised that your Vector of node pointers will be filled with uninitialized pointers; that's something you don't necessarily want.

C++ containers, eg. std::vector<T> and Upp::Vector<T>, unlike C array, can change its size dynamically to accommodate more elements with ease and with high performance (amortized constant speed). So you can safely ignore the MAX_ROW etc part when you translate C code into C++.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MSVC and code size
Next Topic: NaCl office
Goto Forum:
  


Current Time: Wed May 15 17:25:55 CEST 2024

Total time taken to generate the page: 0.01940 seconds