Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use one key with multiple values. For example,
Key: CString
Value1: CString
Value2: Int
Value3: Float
Value4: CString

If i pass any duplicate key it has to overwrite for example already i stored a key called "Car" If i try to store again the same key name and different values it has to overwrite. Plz help me.. Thanks in advance
Posted

Try the STL map[^] class.
 
Share this answer
 
hi,

you need to make class like

C++
public class Vehical
{
 
string key=string.Empty;
string value1=string.Empty;
int value2=0;
string value3=string.Empty; 
string value4=string.Empty; 
}


And now make list object of class vehical
like,

list<vehical> obj;

you can add,update,delete,find and many more using this and lamda expression.

hopes this work for u...
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900