right it work.
But many code accept pointer like this
static void remove(char *NAME){
Friend *ret = find(NAME);
if(ret!=NULL){
vFriend.erase(ret);
}
}
Can i directly convert pointer to iterator?
right it work.
But many code accept pointer like this
static void remove(char *NAME){
Friend *ret = find(NAME);
if(ret!=NULL){
vFriend.erase(ret);
}
}
Can i directly convert pointer to iterator?
But erase takes an iterator not a pointer.
Depends what vFriend is and what it contains.Qt Code:
static void remove(char *NAME){ Friend *ret = find(NAME); if(ret!=NULL){ vFriend.erase(ret); } }To copy to clipboard, switch view to plain text mode
Not in this situation. Especially that you don't have any benefit of using a pointer here.Can i directly convert pointer to iterator?
Bookmarks