Horje
remove duplicates from vector c++ Code Example
erase duplicates and sort a vector
sort( vec.begin(), vec.end() );
vec.erase( unique( vec.begin(), vec.end() ), vec.end() );
remove duplicates from vector c++
sort( vec.begin(), vec.end() );
vec.erase( unique( vec.begin(), vec.end() ), vec.end() );
insert only unique values into vector
std::vector<std::string> name;

....
if (std::find(name.begin(), name.end(), someName) == name.end()) {
  // someName not in name, add it
  name.push_back(someName);
}




Cpp

Related
how to clear screen in C++ console Code Example how to clear screen in C++ console Code Example
c++ create threads Code Example c++ create threads Code Example
how to read a line from the console in c++ Code Example how to read a line from the console in c++ Code Example
reference function in c++ Code Example reference function in c++ Code Example
c++ code for selection sort Code Example c++ code for selection sort Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10