multimap stl

A

Anon

i must create a muiltimap with 2 string , 1 int and 1 iterator to
multimap itself

how could define the typedef?


thank
 
G

Gianni Mariani

i must create a muiltimap with 2 string , 1 int and 1 iterator to
multimap itself

how could define the typedef?

Ask yourself, "what is the key?" and "what is the data?".
 
M

Mark P

one string is a key other are the date

Don't top post. Replies go after whatever you're responding to.

A map (or multimap) key and data must be *types*. The key can be a
string, but the data cannot be "a string, an int, and an iterator"
because that is three types, not a single type. Probably the
appropriate thing to do is define a class or structure to hold those
three quantities and make that class or structure the data type.

struct BunchOfTypes
{
string s;
int i;
multimap<string,BunchOfTypes>::iterator iter;
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top