0
How to remove an option that has been selected?
So im trying to do a card game where in a player will pick between 5 options and after selecting one of the option it is lessened Ex. [1] [2] [3] [4] [5] After picking one. [1] [2] [3] [4] I comepletely have no idea on how to do the code or maybe i have forgotten that it was in my previous lessons but couldnt remember it.
1 Resposta
+ 2
You can use a vector then you can use vector.erase().
Or you can use std::remove defined in <algorithm>
remove(arr.begin(), arr.end(), val)
It will remove every elements contain that value.