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 #38157 is a reply to message #38156] Mon, 03 December 2012 06:30 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
OIC. so before merge, the two vectors have exact same number of elements and the ones with same index correspond to each other.

	VectorMap<int, String> myMap;
	Vector<String>  v1;
	Vector<int>  v2;


	
	for (int i = 0; i < 10; ++i){
		
		v1.Add("String " + AsString(i));
		v2.Add(i); // change here!!	
	}
	
	for (int i = 0; i < 10; ++i){
		
		string a = v1[i];	
		cout << a << endl;
		cout << v2[i] << endl;
                myMap.AddPick(v2[i],v1[i]); // do it here one by one
	
	}
	
	//myMap.AddPick(&v2, &v1); // correct me if there is a member function do what you intended in a single call.
	


HTH
 
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 16:12:07 CEST 2025

Total time taken to generate the page: 0.03979 seconds