I am writing a simple program.. enter first and last name and a search is performed.. and their phone number (if found) is returned.
I have used vector class iterators before a couple of times.. but devcpp does not seem to like this code.. and stops compilation somewhere inside of the algorithm find() function.
void Database::search()
{
do{
iter = find(iter++, vInfo.end(), target_firstname);
//iter = vInfo.at();
}while(iter->last_name != target_lastname && iter != vInfo.end());
if(iter != vInfo.end())
is_found = true;
}
The function searches through a vector of "info"'s in an attempt to match the first name. If successful, the last name is checked. If the the last name does not match, the search continues.. else 'iter' will point to the vector element containing the matching first and last target name.
The entire code has been uploaded for your viewing pleasure. Any help is appreciated in advance.