Re: Pointers, STL....Help
A vector<Person>::iterator is not necessarily a pointer-to-Person. The designers of the STL could have chosen to implement it in any way they liked, such as using a class.
So in your getPerson() function, instead of
Code:
return it; // returns a vector<Person>::iterator
you should have
Code:
return &(*it); // returns a Person*
If that doesn't help, you'll need to post your entire code so we can see what the Person class looks like and how you are using these functions in a program.
Re: Pointers, STL....Help
Besides that....are you doing the lookup very often? In this case I would rather suggest using a map instead...having the name as the key...thus, finding elements will be much faster...