Hi! I'm working on a group project that's due today and I'm receiving the following error:
for this line:Code:.\GroupProject.cpp(169) : error C2784: 'bool std::operator ==(const std::vector<_Ty,_Alloc> &,const std::vector<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::vector<_Ty,_Alloc> &' from 'std::basic_string<_Elem,_Traits,_Ax>' with [ _Elem=char, _Traits=std::char_traits<char>, _Ax=std::allocator<char> ]
when using this function:Code:if((search2[index]==searchItem)&&(search4[index]>=1))
Am I able to compare vector values or is that why I am getting this error message? Any help would be greatly appreciated!Code:void itemLookup(vector<string>& search1, vector<string>& search2, vector<int>& search3, vector<int>& search4, vector<int>& search5, vector<double>& search6, vector<double>& search7, int searchSize) { int searchItem=0; int index; int selection=0; cout<<"Please enter the name of the product to search for: "<<endl; cin>>searchItem; for(index=0; index<searchSize; index++) { if((search2[index]==searchItem)&&(search4[index]>=1)) { cout<<"The item was found"<<endl; cout<<"What information do you need about this item?"<<endl; cout<<"1. Item Number"<<endl; cout<<"2. Pieces Ordered"<<endl; cout<<"3. Pieces In Store"<<endl; cout<<"4. Pieces Sold"<<endl; cout<<"5. Manufacturer Price"<<endl; cout<<"6. Selling Price"<<endl; cout<<"Please enter your selection 1-6: "; cin>>selection>>endl; if((selection<1)||(selection<7)) { if(selection==1) { cout<<search1[index]; } else if(selection==2) { cout<<search3[index]; } else if(selection==3) { cout<<search4[index]; } else if(selection==4) { cout<<search5[index]; } else if(selection==5) { cout<<search6[index]; } else if(selection==6) { cout<<search7[index]; } break; } } else { cout<<"The store does not have this item."<<endl; break; } }
Thanks!
-Andrea



LinkBack URL
About LinkBacks



