Okay, so no ones up to the challenge? I figured out most of it now...still trying to figure out how to print it out(where you see the question mark). If i just use '*p' i get an error about the '<<' operator. Any ideas?? Thanks!
Code:
#include <iostream>
#include <string>
#include <set>
using namespace std;
struct named_pair
{
string name;
int x,y;
named_pair(const string &n,int xx=1, int yy=1):name(n), x(xx), y(yy) {}
bool operator < (const named_pair &l) const
{
return name < l.name;
}
};
int main()
{
string word1 = "does";
string word2 = "this";
string word3 = "work?";
multiset<named_pair> t;
t.insert(named_pair(word1, 1, 1));
t.insert(named_pair(word2, 1, 2));
t.insert(named_pair(word3, 1, 3));
multiset<named_pair>::iterator p;
for (p = t.begin(); p != t.end(); p++)
{
cout << ? ; //here is the problem-child
}
return 0;
}
side note: i did not want to start a new thread, but does anyone know why my visual studio.net keeps stealing focus on my desktop. when i compile and the cosole pops up, i go to look at it and it disapears behind the compiler, very aggravating