KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a function that returns an iterator if an object is found. Now i have a problem. How do i fix the problem of informing the object that called this function that the object was not found? vector<obj>::iterator Find(int id, int test) { vector<obj>::iterator it; aClass class; for(it = class.vecCont.begin(); it != class.vecCont.end(); ++it) { if(found object) //currently in psuedo code return it; } return ???? // <<< if not found what to insert here? } Do i need to change my data structure in this instead? Thanks in advance! :)
Tags (comma-separated)
Save Edits
Cancel