int _tmain(int argc, _TCHAR* argv[])
{
vector<ClassA*> unvector = datafill(3);
string result = search("Object", unvector);
cout<<result;
/* Use this if you need to keep any object/s
int keep = 0;
ClassA* keepObj = unvector[ keep ];
unvector[ keep ] = new ClassA(0,"");
*/
// vector can empty itself, you don't need to iterate through them
unvector.clear();
cin.get();
return 0;
}
Also if you want the search to be case insensitive then first convert the string to one case then when you iterate just make the other one return the same case for you to compare against ( no need to modify the original string though ) with ==.