istream_iterator: Afficher le cotenu d’une chaîne caractère par caractère

Author:

 iterator
{filelink=15191}


#include 
#include 
#include 
#include 
using std::cout;
using std::endl;
using std::istream_iterator;
using std::istringstream;
using std::string;

template  

void afficher(Iter begin, Iter end)
 { 

  for( ; begin != end ;)
    cout<<*begin++<<"n";

}
int main() {

  char* welcom = "Bienvenu sur le cpp.mesexemples.com";

  istringstream bienvenu_str(welcom);
  istream_iterator begin(bienvenu_str);
  istream_iterator end;
  afficher(begin, end);

  return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *