Home » Community » Newbie corner » How to add a struct to a U++ container? 
	
		
		
			| How to add a struct to a U++ container? [message #38599] | 
			Thu, 27 December 2012 00:21   | 
		 
		
			
				
				
				
					
						  
						lectus
						 Messages: 329 Registered: September 2006  Location: Brazil
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		I'm trying something like this: 
 
struct Person { 
String n; 
int a; 
 
Person(String name, int age) { 
n=name; a=age; 
} 
}; 
 
Then I need to add persons like this: 
 
VectorMap<int, Person> m; 
m.Add(1, Person("John", 30)); 
 
But it gives me compile error. Any ideas?
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 09:18:24 CET 2025 
 Total time taken to generate the page: 0.05920 seconds 
 |