Use of as istream_iterator iterator : string output « String « C++






Use of as istream_iterator iterator

  
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
   string words[5] = { "ABCD", "BCDEF", "CERF","DERT", "EFRE"};
   string*   where;

   where = find(words, words + 5, "CD");
   
   cout << *++where << endl;                
   
   sort(words, words + 5);
   
   where = find(words, words + 5, "ER");
   cout << *++where << endl;              
}
  
    
  








Related examples in the same category

1.Read string in and then output
2.Output a string with copy function