Original Post
I found this example at http://www.sgi.com/tech/stl/find.html
I understand this, but what if I have a list like so:
How do I fill the last parameter of the find function? For example if I wanted to find if idata2 equals 4?
[edited by - MagTDK on May 22, 2002 11:49:59 PM]
list<int> L; L.push_back(3); L.push_back(1); L.push_back(7); list<int>::iterator result = find(L.begin(), L.end(), 7);
class CTest
{
int idata;
int idata2;
float idata3;
};
list<int> mylist;
CTest myTest;
myTest.idata = 5;
myTest.idata2 = 10;
myTest.idata3 = 20.00f
mylist.push_back(myTest);
myTest.idata = 2;
myTest.idata2 = 4;
myTest.idata3 = 8.00f
mylist.push_back(myTest);
list<CTest>::iterator result = find(mylist.begin(), mylist.end(), ?);