Hi guys i'm tyring to delete some elements from a vector. I am trying to delete from 0 to k-1 and from k to the end. That means in theory that only element k should remain.
1) cell[j].erase(cell[j].begin(),k-1);
2) cell[j].erase((cell[j].begin()+k+1),(cell[j].end()));
line 2 does not give me an error, however line one gives me:
error C2664: 'std::vector<_Ty>::iterator std::vector<_Ty>::erase(std::vector<_Ty>::iterator,std::vector<_Ty>::iterator)' : cannot convert parameter 2 from 'int' to 'std::vector<_Ty>::iterator'
with
[
_Ty=int
]
and
[
_Ty=int
]
No constructor could take the source type, or constructor overload resolution was ambiguous
does anyone have any ideas? Thanks