vector < string > vsOut; string tmp; for( i=0; !fin.eof(); i++ ) { getline( fin , tmp ); j=find( vsOut.begin(), vsOut.end(), tmp.c_str() ) - vsOut.begin(); if( j != vsOut.size() ) { tmp.erase( 0, tmp.size() ); continue; } if( tmp.empty() ) continue; vsOut.push_back( tmp.c_str() ); tmp.erase( 0, tmp.size() ); }