#include
#include
#include
#include
using namespace std;
int main( ) {
string arrStr[5] = {"A", "B", "A", "D", "E"};
list lstStrDest;
unique_copy(&arrStr[0], &arrStr[5], back_inserter(lstStrDest));
for (list::iterator p = lstStrDest.begin( );
p != lstStrDest.end( ); ++p) {
cout << *p << endl;
}
}
A
B
A
D
E