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 » VectorMap picks two vectors
Re: VectorMap picks two vectors [message #38155 is a reply to message #38153] Mon, 03 December 2012 04:10 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
		v2.Add(new Integer(i));	

This should not compile. You are supplying a Integer* (provided somewhere there is a class called Integer defined) to a function that expects a int

Simply:
      v2.Add(i);

will do.

As for VectorMap part, I think it's not intended to be used the way you use it. A VectorMap is a map which serves to find a value from a key. In your case you want to find a String from a int, you more likely should do something like this:
	VectorMap<int , String> myMap;


	
	for (int i = 0; i < 10; ++i){
	     myMap.Add(i, String().Cat()<<"String "<<i);	
	}
	


And later on you can efficiently find the String associated with an int or if there is one. Refer to Find(...), FindPtr() for template class AMap (who is the base of VectorMap)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multi-Threading newbie questions
Next Topic: Fixed Frame Size Dockable Controls
Goto Forum:
  


Current Time: Wed Apr 30 20:36:00 CEST 2025

Total time taken to generate the page: 0.00928 seconds