Guest User

Untitled

a guest
Jul 16th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. void findCustomer(vector<Customer> &theCust)
  2. {
  3. if(theCust.empty())
  4. cout<<"---No Customer---"<<endl;
  5. else
  6. {
  7. cout<<"Enter customer name : "<<flush;
  8. string custName;
  9. cin>>custName;
  10. bool find = false;
  11. vector<Customer>::iterator iter;
  12. for(iter = theCust.begin(); iter != theCust.end(); iter++)
  13. {
  14. if(iter->getName() == custName)
  15. {
  16. iter->display();
  17. find = true;
  18. }
  19. }
  20. if(find == false)
  21. cout<<"No Customer"<<endl;
  22.  
  23.  
  24. //theCust.erase(iter);
  25. //else
  26. //cout<<"No match found"<<endl;*/
  27. /*iter = find(theCustomer.begin(),theCustomer.end(), inCustomer);
  28. if (iter != theCustomer.end())
  29. {
  30. theCustomer.erase(inCustomer);*/
  31. }
  32. }
Add Comment
Please, Sign In to add comment