I want to go through a vector and delete any strings that contain nothing.
ex: a vector containing:
>one <
><
>two <
>three<
I want to get rid of the >< elemnt and have only :
>one <
>two <
>three<
I tried this:
andCode:for (i=0; i<4; i++) { if(vars.vectParmSelected[i].ParamName[0] == '\0') vars.vectParmSelected.erase(i); }Code:struct structLink { CString ParamName; int Index; };i get an errorCode:vector <structLink> vectParmSelected;But I do want to delete the whole structure at position i. How would this be fixed?Code:error C2664: 'struct structLink *__thiscall std::vector<struct structLink, class std::allocator<struct structLink> >::erase(struct structLink *)' : cannot convert parameter 1 from 'int' to 'struct structLink *'



LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.