Here is my array: Arr[8] = {24, 30, 30, 32, 32, 36, 36, 36};
I am trying to eliminate the duplicate numbers from Arr using C++. Any suggestions? Thank you!
sort( vec.begin(), vec.end() );
vec.erase( unique( vec.begin(), vec.end() ), vec.end() );
std::vector, not a C-style array like: int[8].unique(...) - arr.vec.erase (and vec.begin() as oppose to using std::begin(vec)). Either way, this question has to be dube.
map? Put them in asetand print them.std::unique